How licensing works
|In this topic:|
How licensing works
This section discusses how licensing works. Basic License Server installation and setup is straightforward, and is covered in Installing Klocwork.
Klocwork issues the following types of licenses: build licenses, continuous integration licenses, user licenses, and concurrent licenses.
A build license, most often referred to as a fixed build license, allows you to run one or more full analyses on a specific machine. The license is locked to the machine itself and loads results to the Klocwork Portal. This is the kind of license you need if you install and run Klocwork analyses on a long-lived, dedicated machine.
How the build license works
- A build license is checked out when any of the below tools is started and is returned when the tool exits. The license is available for other hosts after the linger time of two weeks expires. The exception to this is the kwstruct101 tool that has a linger time of one week.
- One build license is checked out for each unique host.
- All tools that consume a build license are reserved for that host.
- If you have installed components from both the Server and desktop analysis plug-in packages on a single host, and you run tools from both packages simultaneously (for example, using Klocwork Desktop Java Plug-in for Eclipse as well as running kwbuildproject), you will use two licenses (in this case, a user license and a build license).
What tools can consume a build license?
Continuous integration license
A continuous integration license allows you to run a full baseline analysis followed by delta analyses. The output of analyses provide lists of new and fixed issues. Results are loaded to a JSON file or to the TeamCity or Jenkins plugins.
How the continuous integration license works
- kwconan is invoked
- when kwbuildproject is invoked with the --conan option
- during the kwconan stage of the TeamCity and Jenkins plugins
A continuous integration license is checked out when any of the below tools is started and returned when the tool exits. The license is available for other hosts after the linger time of two weeks expires.
One continuous integration license is checked out for each unique host that the tools are run on. For TeamCity, a license is required for each agent; for Jenkins, a license is required for each node. The license is then reserved for the host it was checked out on.
What tools can consume a continuous integration license?
A user license allows individuals to run the Klocwork Desktop tools, plug-ins or log in to the Klocwork Portal.
How the user license works
Once a license is checked out by a user, the rest of the user tools listed below are reserved for them. You can use any number of the tools listed below with a single user license, as long as you log in with the same user ID. The license is available for other users after any time-out time plus the linger time of one week expires.
If you have different user IDs when you log in to different operating systems, Klocwork consumes one license for each. For example, if your Windows login is "John Smith" and your Linux login is jsmith, Klocwork consumes two licenses.
Example 1: LDAP or Single sign-on
If you have LDAP or Single sign-on configured and you attempt to log in to both a Windows and a Linux machine where the user credentials are different, two licenses are consumed.
For example, a user, John Smith, logs into Windows with full name ('John Smith'), and logs into his Linux machine which uses a short name like 'jsmith'. In this case, if John Smith uses Klocwork from Windows and Linux, two licenses are consumed.
Example 2: Alternate access methods
If you use an alternate access method such as NIS or Basic, a license is checked out for each user that logs into Klocwork or Code Review. When logging in, be sure to use the same login credentials that you use when running the command line tools.
What tools can consume a user license?
There are two types of concurrent licenses: a build agent license and a CI agent license.
How the build agent license works
A build agent license allows you to run a single analysis on any machine and load the results to the Klocwork Portal. This is the kind of license you need if you're using containers or spinning up machines in the cloud to do the analysis--wherever you have temporary environments.
A build agent license provides the tools listed below with the proper license to run a single analysis on a single server at one time. To run analyses concurrently, you need multiple build agent licenses. For example, if you want to run five analyses at once, you need to have five build agent licenses. Klocwork checks out a license when you run the command and returns it when the command completes. There is no linger time for this kind of license.
What tools can consume a build agent license?
How the CI agent license works
The CI agent license is useful for analysis in a CI environment because it allows you to do a quick analysis of parts of an application--one or more files. Use this license type when you want to analyze only a single file or set of files, not an entire application. To make it possible, you need to connect to a project.
This capability is useful in a pre-check-in environment, where you can, for example, set up the build to fail under certain conditions, such as if there are new issues detected.
The CI agent output can be directed to a text file. Or, for example, if you're running the command on Jenkins, the CI agent output can be directed to the Jenkins console log. Whereas the kwbuildproject analysis results (used by other license types) are loaded to the Klocwork Portal, the kwciagent analysis results are local to the CI agent workspace. You cannot load results to the Klocwork Portal and you need a connected project.
A CI agent license is checked out when you run the command and returns it when the command completes. There is no linger time for this kind of license.
What tools can consume a CI agent license?
Definitions: linger and fixed
Klocwork offers build, user, continuous integration, and concurrent licenses, most of which have a linger time. Linger time is the amount of time after the last use of a license before it is free for another user or command to check it out. Note that Klocwork starts counting the linger times at the end of the inactivity time-outs that some Klocwork components have.
Build licenses are used to run the Klocwork integration build analysis on a build server. Build licenses are always node-locked to a host name, or "fixed". A fixed build license has a long linger period of two weeks (1,209,600 seconds).
Continuous Integration (CI) licenses are used when kwconan is invoked, when kwbuildproject is invoked with the --conan option, or during the kwconan stage of the TeamCity and Jenkins plugins. A CI license has a linger time of two weeks (1,209,600 seconds).
User licenses are used by everyone who uses Klocwork tools. A user license has a linger time of 7 days (604,800 seconds).
Concurrent licenses have no linger time and are available for use as soon as the process or command using the license finishes and returns the license.
Detailed look at how the user license works
Many of the tools that consume a user license have a time-out period associated with them. All user licenses have a one-week linger period. When a license is returned after the time-out expires, the license is not available to other users until the linger period of one week expires.
|Klocwork Static Code Analysis Klocwork Code Review||Checks out a license when you log in and returns it when you log out or after 30 minutes of inactivity. You can have Klocwork Static Code Analysis open in two different browsers, for example Chrome and Firefox, and as long as you are logged into both with the same user ID you will only consume one user license. Logging in to Static Code Analysis with the same user ID on an additional machine will cause any existing sessions for that user ID to be logged out. Returning to a machine logged out in such a way and performing any action will cause the Login dialog to appear.|
|Visual Studio C/C++ Extension or addin||Checks out a license when you open a solution or workspace. Returns the license when you close Visual Studio or when the 20-minute time-out period expires.|
|Plug-ins for Visual Studio C#, Eclipse Java, Eclipse C/C++ and IntelliJ IDEA, or Klocwork Desktop||Checks out a license when you run a Klocwork task, such as running an analysis (including C/C++ continuous analysis). Returns the license when you close Visual Studio or after 20 minutes of inactivity. In Eclipse, the license is returned after 20 minutes of inactivity, if Eclipse is closed or restarted, or if the user switches workspaces.|
|kwcheck||Checks out a license when you run the command and returns it when the command completes. This command has no time-out period.|