Metric¶
- class understand.Metric¶
Bases:
object
Accessors for available metrics and metric descriptions.
Methods Summary
Return a description of the metric.
Return a list of metric ids.
Return the name of the metric.
Methods Documentation
- description(metricid) str ¶
Return a description of the metric.
- Parameters:
metricid (str) – the id of the metric
- Return type:
str
- Returns:
the description of the metric or empty string if the metric id is not found.
- list([kindstring[, db[, filter]]]) list[str] ¶
Return a list of metric ids.
- Parameters:
kindstring (str or None) – optional, a language-specific entity filter string
db (understand.Db) – optional, a database. A database is required to list metric plugins by kindstring. Providing a database limits results to metrics potentially applicable to the database or entities in the database. For built-in metrics, this will remove any metrics that don’t match the database languages. For metric plugins, this removes any plugins that don’t return True from the test_available function.
filter (bool) – optional, defaults to True. When True filter the results to only enabled metrics.
- Return type:
list[str]
- Returns:
metrics defined for entities matching the given kindstring or all possible metric names if no kindstring is given.
- name(metricid) str ¶
Return the name of the metric.
- Parameters:
metricid (str) – the id of the metric
- Return type:
str
- Returns:
the name of the metric or empty string if the metric id is not found.