The Full Cycle - From Modules to Automated License Checks

來源 : ZDNet
雖然企業軟體在現代生活中扮演相當重要的角色,但大部分都是無趣的。因為這些專案通常是大型且容易失敗,無法輕易破解螢幕畫面以及在毫無意義的軟體更新中,供應商已經失去創新的意願。為了讓美好的感覺再回到企業,以下是讓企業軟體更具吸引力的五大法則:
1. 具功能性且適用於工作: 在基層工作方面,軟體的基本功能就是讓使用者可以順利完成任務,如果連這點都做不到,那麼軟體就失去存在的意義。
2. 涵蓋商業流程領域: 企業軟體應可以自動處理特定商業流程,像是CRM、會計等等。好的企業軟體必須能提供全方位且自動化的流程處理。
3. 絕佳的使用者介面: 最好的軟體就是讓用戶可以很快了解並上手,並且容易導入。如果無法達到此要求,那麼這個軟體就沒有吸引力了。
4. 感覺良好的魔力: 千萬不要輕忽感覺的影響力,這是另一項評量使用者是否滿意的指標。通常失敗的案子,在感覺良好的得分都是0。
5. 激烈的競爭: 創新是需要競爭及要求來激發的。如果沒有競爭的壓力,根本無法設計出具吸引力的企業軟體。
The Violations plugin
The Violations plugin is a one-stop-shop for code quality metrics. It supports the principal Java code quality tools: checksytle, pmd, cpd, findbugs, and simian, plus a few others.
Use this plugin to keep track of how your code quality metrics are doing over time, or to review various code quality metrics for a particular build. You can even force a build to fail if there are too many violations. If you do this, just be careful not to interrupt the developer flow too much. For example, you might set up a special QA build (run every night or every hour, for example), that will fail if the QA metrics aren't up to scratch.
The only catch is that you have to integrate the code quality metrics (checkstyle, PMD, Findbugs, or whatever) into your builds. If you are creating new build scripts, you should of course be doing this anyway, but it can be more of a challenge for large legacy code bases.
Clover is a kick-ass code coverage tool if there ever was one, and the Hudson Clover plugin is an excellent complement to the tool. The Clover plugin is unique: it lets you add code coverage to (most) existing Ant builds without having to change the build file. This is great for legacy projects. It also lets you generate aggregate coverage statistics on multi-module Maven projects.
If you don't have Clover, all is not lost - the Coberturaand Emma plugins do a great job too, though you do have to set up the code quality metrics in your project yourself first.
The Parameterized Trigger pluginThe Parameterized Trigger plugin lets you add parameters to your build jobs that users enter when they kick off a build. This comes in handy for release or deployment automation, for example, where you want to enter the version number or label you want to release or deploy. You can also get your build job pass these parameters on to other parameterized build jobs.
The Sonar pluginThe Sonar plugin makes it trivial to integrate your projects with Sonar. Sonar is a powerful open source code quality metrics reporting tool, which displays code quality metrics for multiple projects in a variety of ways on a web site.
The Sonar Hudson plugin is magic. It lets you integrate your existing Maven projects into Sonar, with no modifications to the projects. It even works for Ant projects, though there is some configuration to do in this case.
The VMware pluginThe VMWare plugin lets you start up a VMWare virtual machine before a build, and shut it down afterwards. This is excellent for functional or web tests on different platforms.
The Amazon EC2 pluginThe Amazon EC2 plugin lets you start up Hudson slaves an EC2 instance on demand, and then shut them down when they are no longer required. Again, this is great for cross-platform tests, but also for load tests, or periods when you need to expand your CI capacity greatly for a short period of time (just before major releases, for example).
The Setenv pluginThe The Setenv plugin lets you set environment variables for a particular build job. These environment variables are available to any sort of build job, be it Freestyle, Maven, Shell, or whatever. Many build scripts use environment variables for a variety of purposes, and this plugin makes it much easier to integrate these projects into Hudson.
Sectioned View pluginThe Sectioned View Plugin lets you break your job views into sections, such as 'Test Results' and 'Job Graphs'.
The Radiator View Plugin lets you display the build status for your projects in a format that is easy to see from a distance. Set this up on a large LCD screen visible to all.
And finally, the Hudson Helper iPhone app. This is a neat little iPhone app that lets you monitor your builds via your iPhone. Don't leave home without it!
sudo apt-get install apache2
sudo a2enmod proxy
sudo a2enmod proxy_http
ProxyPass /hudson http://localhost:8081/hudson但此時內部 server 透過 api 拿到的 ip 都會是此 proxy server 的 IP 。若要拿到 real IP 則需要透過 http header 拿,這些 header 如下
ProxyPassReverse /hudson http://localhost:8081/hudson
ProxyRequests Off
# Local reverse proxy authorization override
# Most unix distribution deny proxy by default (ie /etc/apache2/mods-enabled/proxy.conf in Ubuntu)
Order deny,allow
Allow from all
For a recent edition of the Swiss Computerworld Magazine we listed our Top 10 Performance Problems as we have seen them over the years when working with our clients. I hope this list is enlightening – and I’ve included follow-up links to the blogs to help better understand how to solve these problems:
The problem we see the most are too many database query per request/transaction. There are 3 specific phenomena to witness
Further Reading: Blog on Linq2Sql Performance Issues on Database, Video on Performance Anti-Patterns
There is no question that synchronization is necessary to protect shared data in an application. Too often developers make the mistake to over-synchronize, e.g.: excessively-large code sequences are synchronized. Under low load (on the local developers workstation) performance won’t be a problem. In a high-load or production environment over-synchronization results in severe performance and scalability problems.
Further Reading: How to identify synchronization problems under load
Many libraries out there make remote communication seem like a piece of cake. There is hardly any difference for the developer to call a local vs. remote method. The lack of understanding of what is really going on under the remoting-hood makes people forget about things like latency, serialization, network traffic and memory usage that come with every remoting call. The easy way of using these technologies results in too many calls across these remoting boundaries and in the end causes performance and scalability problems.
Further Reading: Performance Considerations in Distributed Applications
Object-Relational Mappers take a big burden off developers’ shoulders – loading and persisting objects in the database. As with any framework there usually are many configuration options to optimize the usage of the O/R Mapper for current application use cases. Faulty settings and incorrect usage of the framework itself too often results in unexpected performance and scalability problems within these frameworks. Make sure you make yourself familiar with all options and learn about the internals of these libraries that you rely on.
Further Reads: Understanding Hibernate Session Cache, Understanding the Query Cache, Understanding the Second Level Cache
Managed runtime environments such as Java and .NET have the advantage of helping with memory management by offering Garbage Collectors. A GC, however, does not prevent memory leaks. Objects that are “forgotten” will stick around in memory and ultimately lead to a memory leak that may cause an OutOfMemoryException. It is important to release object references as soon as they are no longer needed.
Further Read: Understanding and finding Memory Leaks
Nobody is writing all of the functionality of a new application on their own. We use existing 3rd party libraries to speed up our development process. Not only do we speed up our output – but we also increase performance risks introduced by these components. Even though most frameworks are well documented and have been thoroughly tested, there is no guarantee that these frameworks run as expected in every use case they are included. 3rd party code is often used incorrectly or in ways that have not been tested. It is therefore important to make an in-depth check of every framework before introducing it into your code.
Further Read: Top SharePoint Performance Mistakes
Resources such as memory, CPU, I/O or the database are scarce. Wasteful handling of these resources results in lack of access to these resources by others and ultimately leads to performance and scalability issues. A good example: database connections that are kept open for too long. Connections must only be used for the time period they are really needed, e.g.: for a query – and then returned to the connection pool. We often see that connections are requested early on in the request handler and are not released until the very end which leads to a classic bottleneck situation.
Further Read: Resource Leak detection in .NET Applications
Thanks to high-speed web access many users have a better end-user experience in the World Wide Web. The downside of this trend is that many applications get packed with too much stuff – they become bloated – which ultimately leads to bad browsing behavior. Particularly users that do not yet have high-speed internet access suffer the most. Too many images that are too large; failure to use or incorrect usage of the browser cache; or overly-aggressive usage of JavaScript/AJAX – all result in performance problems in the browser. Following the existing Best Practices on Web Site Performance Optimization can solve most of these problems:
Further Read: How Better Caching would help speed up Frankfurt Airport Web Site
Caching objects in memory to avoid constant roundtrips to the database is one way to boost performance. Caching too many objects – or objects that are hardly ever used quickly changes the advantage of caching into a disadvantage due to higher memory usage and increased GC activity. Before implementing a caching strategy you have to figure out which objects to cache and which objects not to cache in order to avoid these types of performance and scalability problems:
Further Reads: Java Memory Problems, Identify GC Bottlenecks in Distributed Applications
Intermittent problems are hard to find. These are usually problems that occur with specific input parameters or only happen under certain load conditions. Full test coverage – functional as well as load and performance coverage – will uncover most of these problems early on before they become real problems for real users.
Further Reads: Tracing Intermittent Errors by Lucy Monahan from Novell, How to find invisible performance problems
With remoting communication – such as Web Services, RMI or WCF – objects need to serialized by the caller in order to be transferred over the network. The callee on the other side needs to de-serialize the object before it can be used. Transformation therefore happens on both sides of the call resulting in some overhead while doing so. It is important to understand what type of serialization is required by both ends and what the optimal choice of serialization and transport type is. Different types of serialization have a different impact on performance, scalability, memory usage and network traffic.
Further Read: Performance Considerations in Distributed Applications