summaryrefslogtreecommitdiff
path: root/doc/source/specification/measurements.rst
blob: 214b555cb00dc00ab5f60c96d109722ec6c78066 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
..
      Copyright 2014 IBM Corp.

      Licensed under the Apache License, Version 2.0 (the "License"); you may
      not use this file except in compliance with the License. You may obtain
      a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

      Unless required by applicable law or agreed to in writing, software
      distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
      WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
      License for the specific language governing permissions and limitations
      under the License.

.. _measurements:

=============
 Measurements
=============

A component that contains statistical or measurement information for TARGET
resources that are being monitored. The measurement should be based upon a
defined metric (a method of measurement).

============ =============== ========= =================================================================================================================
Property     Type            Required  Description
============ =============== ========= =================================================================================================================
result       xs:any          Yes       The quantitative or qualitative result of a measurement from applying the associated metric
metric       cadf:Metric     Dependent The property describes the metric used in generating the measurement result. Required if not metricId
metricId     cadf:Identifier Dependent This property identifies a CADF Metric by reference and whose definition exists elsewhere. Required if not metric
calculatedBy cadf:Resource   No        An optional description of the resource that calculated the measurement
============ =============== ========= =================================================================================================================

Metrics
=======

The Metric data type describes the rules and processes for measuring some
activity or resource, resulting in the generation of some values (captured by
the Measurement type).

=========== =============== ======== ==================================================
Property    Type            Required Description
=========== =============== ======== ==================================================
metricId    cadf:identifier Yes      The identifier for the metric.
unit        xs:string       Yes      The metrics unit (e.g., "ms", "Hz", "GB", etc.)
name        xs:string       No       A descriptive name for metric
annotations cadf:map        No       User-defined metric information.
=========== =============== ======== ==================================================

Serialisation
=============

.. code-block:: javascript

    {
        "typeURI": "http://schemas.dmtf.org/cloud/audit/1.0/log",
        ...,
        "metrics": [
            {
                "metricId": "myuuid://metric.org/1234",
                "unit": "GB",
                "name": "Storage Capacity in Gigabytes"
            }
        ],
        ...,
        "events": [
            {
                "typeURI": "http://schemas.dmtf.org/cloud/audit/1.0/event",
                ...,
                "measurements": [
                    {
                        "result": "10",
                        "metricId": "myuuid://metric.org/1234"
                    }
                ]
            }
        ]
    }