MetricId¶
- class understand.MetricId¶
Bases:
object
Metric plugin object
This object is provided to a metric plugin’s test_* and value functions. Use the
id()
to find the requested metric id.Methods Summary
Return a
cache
that can be used to store, retrieve, and share data.Return the database associated with this metric.
The id of the requested metric.
Return the list of built-in metrics
Methods Documentation
- cache([id]) understand.Cache ¶
Return a
cache
that can be used to store, retrieve, and share data. If id is not given, it will be a script-specific identifier. This function may return None if caching is not available.- Return type:
- Returns:
a cache object or None
- db() understand.Db ¶
Return the database associated with this metric.
- Return type:
- Returns:
the database
- id() str ¶
The id of the requested metric.
- Return type:
str
- list(ent) list[str] ¶
- list(arch) list[str]
- list(db) list[str]
- list(entkindstr) list[str]
Return the list of built-in metrics
This only lists metrics calculated by Understand, and does not include any metrics provided by plugins. So, it is safe to call from a metric plugin. This function should be used instead of the following four functions:
ent.metrics
,arch.metrics
,db.metrics
, orMetrics.list
. Those functions are not safe to call from a Metric plugin because they include metrics defined by metric plugins.- Parameters:
arch (understand.Arch) – an architecture to list metrics for
ent (understand.Ent) – an entity to list metrics for
db (understand.Db) – a database to list metrics for
entkindstr (str) – an entity kind string which may be empty.
- Return type:
list[str]