ssid-collection.json - sstore collections
Collections define named groups of statistics and events. Collections are available in the namespace for your use. ssids included in a collection can be enabled or disabled as a group and can be captured and exported as a group.
You can specify collections either by API, described in the sstore_collection_alloc(3SSTORE) man page, or by a JSON file, as described in this man page.
Collection names usually include the name of the user who created them as shown in the following syntax:
//:class.collection//:collection.name/<username>/<collection-name>
To modify a collection, you must have created it or have been granted the privilege to modify it. If you create a collection as a current statistics store user, then the collection can be shown without specifying the user name as shown in the following syntax:
//:class.collection//:collection.name/<collection-name>
Each collection has a UUID, which is a unique number. The UUID of a collection remains the same even if the collection is renamed. The following example shows the UUID of a collection:
//:class.collection//:collection.uuid/a6cbcf8b-3997-4467-8d90-80fab24e836e
The sstore list and sstore info commands show information about the collections defined on the system. See the sstore(1) man page for more information.
The following command lists all the collections owned by user root:
$ sstore list //:class.collection//:collection.name/root/*
The following command shows information about collections owned by the current user, including the list of ssids in the collections, whether the collection is enabled or disabled, and the name, owner, and UUID of the collection:
$ sstore info //:class.collection//:collection.name/*
The JSON file describing a collection should be named as follows:
<username>.<collection-name>.json
Collections described by JSON files must be delivered into the following directory:
/usr/lib/sstore/metadata/collections
Collections delivered by JSON files can only be enabled and disabled by using the API. You cannot use the API to add ssids or make other modifications to a collection that is delivered by a JSON file.
The following example shows how a collection delivered by Oracle Solaris is defined in a JSON file named root.cpu-stats.json:
The JSON file is placed in the recommended directory as follows:
/usr/lib/sstore/metadata/collections/root.cpu-stats.json
The root.cpu-stats.json file contains the following content:
{ "$schema": "//:collection", "copyright": "Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.", "description": "general cpu statistics", "enabled": true, "id": "cpu-stats", "ssids": [ "//:class.cpu//:res.id/*//:stat.usage", "//:class.cpu//:res.id/*//:stat.integer-pipe-usage" ], "user": "root" }
This JSON file creates a collection with the following collection name:
//:class.collection//:collection.name/root/cpu-stats
Contains the JSON schema used by the JSON file. The value of this field must be //:collection.
Contains a short, human-readable description of the purpose of the collection.
Declares whether the statistics and events defined in the collection should be captured. The sstoreadm(1) command can be used to override the value delivered in the file. The sstore info command shows whether a collection is currently enabled.
Contains the name of the collection.
Contains the list of ssids to be captured. Wildcards, slices and all other ssid syntaxes are allowed.
Contains the name of the user who owns the collection.
To put multiple collections into a single file, use [ and ] as shown in the following example:
[ { "$schema": "//:collection", "copyright": "Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.", "description": "general cpu statistics", "enabled": true, "id": "cpu-stats", "ssids": [ "//:class.cpu//:res.id/*//:stat.usage", "//:class.cpu//:res.id/*//:stat. integer-pipe-usage" ], "user": "root" }, { "$schema": "//:collection", "copyright": "Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.", "description": "general network statistics", "enabled": true, "id": "network-stats", "ssids": [ "//:class.link/*//:res.*//:stat.in-bytes", "//:class.link/*//:res.*//:stat.out-bytes", "//:class.link/*//:res.*//:stat.ifspeed" ], "user": "root" } ]