This is documentation for Caché & Ensemble.

For information on converting to InterSystems IRIS, see the InterSystems IRIS Adoption Guide and the InterSystems IRIS In-Place Conversion Guide, both available on the WRC Distributions page (login required).

Home > Class Reference > %SYS namespace > %iKnow.Metrics.Metric

%iKnow.Metrics.Metric

SQL Table Name: %iKnow_Metrics.Metric

The %iKnow.Metrics infrastructure is deprecated in favour of the more SQL-oriented approach offered through %iKnow.Tables.Utils, where you can add computed fields at different levels and choose whether they need to be persisted or not.

This class represents custom metric definitions in your iKnow domain, which express a particular metric of interest for your applications. If you are manually setting individual values, you can instantiate and work with this class directly as follows:

  1. Create a Metric object using %New() and save it using %Save()
  2. Register one or more target types using AddTargetType()
  3. Set and retrieve individual values using GetValue() and SetValue().

Please refer to %iKnow.Metrics.MetricDefinition for a more declarative way of defining and managing custom metrics. and %iKnow.Metrics.MetricBuilder for more coordinated ways to calculate metric values. Using this class directly is not recommended.

See also %iKnow.Metrics.MetricAPI for more functionality and queries.

Property Inventory

Method Inventory

Properties

property BuilderClass as %String;
Property methods: BuilderClassDisplayToLogical(), BuilderClassGet(), BuilderClassIsValid(), BuilderClassLogicalToDisplay(), BuilderClassLogicalToOdbc(), BuilderClassNormalize(), BuilderClassSet()
property DefinitionClass as %String [ ReadOnly ];
Property methods: DefinitionClassDisplayToLogical(), DefinitionClassGet(), DefinitionClassIsValid(), DefinitionClassLogicalToDisplay(), DefinitionClassLogicalToOdbc(), DefinitionClassNormalize()
property Description as %String (MAXLEN = 500);
Property methods: DescriptionDisplayToLogical(), DescriptionGet(), DescriptionIsValid(), DescriptionLogicalToDisplay(), DescriptionLogicalToOdbc(), DescriptionNormalize(), DescriptionSet()
property DomainId as %Integer [ Required , ReadOnly ];
Property methods: DomainIdDisplayToLogical(), DomainIdGet(), DomainIdIsValid(), DomainIdLogicalToDisplay(), DomainIdNormalize()
property GroupField as %String;
Property methods: GroupFieldDisplayToLogical(), GroupFieldGet(), GroupFieldIsValid(), GroupFieldLogicalToDisplay(), GroupFieldLogicalToOdbc(), GroupFieldNormalize(), GroupFieldSet()
property MaintainIndex as %Boolean;
Property methods: MaintainIndexDisplayToLogical(), MaintainIndexGet(), MaintainIndexIsValid(), MaintainIndexLogicalToDisplay(), MaintainIndexNormalize(), MaintainIndexSet()
property MetricId as %Integer [ Required , ReadOnly ];
Property methods: MetricIdDisplayToLogical(), MetricIdGet(), MetricIdIsValid(), MetricIdLogicalToDisplay(), MetricIdNormalize()
property Name as %String [ Required , ReadOnly ];
Property methods: NameDisplayToLogical(), NameGet(), NameIndexCheck(), NameIndexCheckUnique(), NameIndexDelete(), NameIndexExists(), NameIndexOpen(), NameIndexSQLCheckUnique(), NameIndexSQLExists(), NameIndexSQLFindPKeyByConstraint(), NameIndexSQLFindRowIDByConstraint(), NameIsValid(), NameLogicalToDisplay(), NameLogicalToOdbc(), NameNormalize()
property Type as %String (VALUELIST = ",domain,source,group") [ InitialExpression = $$$IKMTRTYPEDOMAIN , Required , ReadOnly ];
Property methods: TypeDisplayToLogical(), TypeGet(), TypeIsValid(), TypeLogicalToDisplay(), TypeLogicalToOdbc(), TypeNormalize()

Methods

method BuildIndices() as %Status
Builds all indices for target types supported by this metric.
method ClearValues(pTargets As %List = "") as %Status
Erases any existing values for this metric, optionally restricted to a particular (set of) targets.
method GetValue(pTargetType As %String, pTargetId As %Integer, pContext As %String = "") as %Numeric

Returns the value of a particular "target" element identified by pTargetId (for example, when pTargetType = $$$IKMTRENTITY, pTargetId is a unique entity ID).

When Type '= $$$IKMTRTYPEDOMAIN, pContext is mandatory and should be a source ID for $$$IKMTRTYPESOURCE or a metadata value for $$$IKMTRTYPEGROUP.

method SetValue(pTargetType As %String, pTargetId As %Integer, pValue As %Integer, pContext As %String = "") as %Status

Sets the value of a particular "target" element identified by pTargetId (for example, when pTargetType = $$$IKMTRENTITY, pTargetId is a unique entity ID) to pValue.

When Type '= $$$IKMTRTYPEDOMAIN, pContext is mandatory and should be a source ID for $$$IKMTRTYPESOURCE or a metadata value for $$$IKMTRTYPEGROUP.

Indexes

index (NameIndex on DomainId,Name) [Unique];
Index methods: NameIndexCheck(), NameIndexCheckUnique(), NameIndexDelete(), NameIndexExists(), NameIndexOpen(), NameIndexSQLCheckUnique(), NameIndexSQLExists(), NameIndexSQLFindPKeyByConstraint(), NameIndexSQLFindRowIDByConstraint()
index (PKINDEX on DomainId,MetricId) [IdKey, PrimaryKey, Type = key, Unique];
Index methods: PKINDEXCheck(), PKINDEXDelete(), PKINDEXExists(), PKINDEXOpen(), PKINDEXSQLCheckUnique(), PKINDEXSQLExists(), PKINDEXSQLFindPKeyByConstraint(), PKINDEXSQLFindRowIDByConstraint()

Inherited Members

Inherited Methods

Storage

Storage Model: CacheSQLStorage

Maps: 2

FeedbackOpens in a new window