How licensing works
This section discusses how licensing works. Basic License Server installation and setup is straightforward.
- build
- user
- web service
- concurrent
Build license
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.
- 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?
- kwadmin
- kwbuildproject
- kwecbuild
- kwstruct101
User license
A user license allows you 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.
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?
- Klocwork portal
- IDE plugins
- kwcheck
- Klocwork Desktop
- Klocwork Refactoring
- Klocwork Code Review
Web service license
A web service license allows you to run the Klocwork servers.
How the web service license works
After you install the Klocwork Server package, one of the steps is to start the Klocwork Server. Starting the Klocwork Server, either by using the kwservice command or as a Windows Service, requires a web service license. Klocwork releases the license when you stop the Klocwork Server. Each projects_root directory consumes an instance of kwservice.
What tools can consume a web service license?
- kwservice
Concurrent licenses
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.
What tools can consume a build agent license?
- kwbuildproject
- kwadmin
- kwstruct101
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.
What tools can consume a CI agent license?
- kwciagent
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.
Tool | Licensing behavior |
---|---|
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 | 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. |