Class Reference
IRIS for UNIX 2019.2
InterSystems: The power behind what matters   
Documentation  Search
  [ENSLIB] >  [%iKnow] >  [Metrics] >  [Metric]
Private  Storage   

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.

Inventory

Parameters Properties Methods Queries Indices ForeignKeys Triggers
9 11 2


Summary

Properties
BuilderClass DefinitionClass Description DomainId
GroupField MaintainIndex MetricId Name
Type

Methods
%AddToSaveSet %AddToSyncSet %CheckConstraints %CheckConstraintsForExtent
%ClassIsLatestVersion %ClassName %ComposeOid %ConstructClone
%Delete %DeleteExtent %DeleteId %DispatchClassMethod
%DispatchGetModified %DispatchGetProperty %DispatchMethod %DispatchSetModified
%DispatchSetMultidimProperty %DispatchSetProperty %Exists %ExistsId
%Extends %GUID %GUIDSet %GetLock
%GetParameter %GetSwizzleObject %Id %IsA
%IsModified %IsNull %KillExtent %LockExtent
%LockId %New %NormalizeObject %ObjectIsNull
%ObjectModified %Oid %OnBeforeAddToSync %OnDetermineClass
%Open %OpenId %OriginalNamespace %PackageName
%PurgeIndices %Reload %RemoveFromSaveSet %ResolveConcurrencyConflict
%RollBack %Save %SaveDirect %SerializeObject
%SetModified %SortBegin %SortEnd %SyncObjectIn
%SyncTransport %UnlockExtent %UnlockId %ValidateIndices
%ValidateObject BuildIndices ClearValues GetValue
SetValue


Properties

• property BuilderClass as %String;
• property DefinitionClass as %String [ ReadOnly ];
• property Description as %String(MAXLEN=500);
• property DomainId as %Integer [ ReadOnly ];
• property GroupField as %String;
• property MaintainIndex as %Boolean;
• property MetricId as %Integer [ ReadOnly ];
• property Name as %String [ Required,ReadOnly ];
• property Type as %String(VALUELIST=",domain,source,group") [ InitialExpression = $$$IKMTRTYPEDOMAIN,Required,ReadOnly ];

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.


Indices

•index (NameIndex on DomainId,Name) [Unique];
•index (PKINDEX on DomainId,MetricId) [IdKey,PrimaryKey,Unique];


Copyright (c) 2019 by InterSystems Corporation. Cambridge, Massachusetts, U.S.A. All rights reserved. Confidential property of InterSystems Corporation.