Utility functions and classes¶
InfluxGraph utility functions
-
class
influxgraph.utils.
Query
(pattern)¶ Graphite-API compatible query class
-
influxgraph.utils.
calculate_interval
(start_time, end_time, deltas=None)¶ Calculates wanted data series interval according to start and end times
Returns interval in seconds :param start_time: Start time in seconds from epoch :param end_time: End time in seconds from epoch :type start_time: int :type end_time: int :param deltas: Delta configuration to use. Defaults hardcoded if no
configuration is providedReturn type: int - Interval in seconds
-
influxgraph.utils.
gen_memcache_key
(start_time, end_time, aggregation_func, paths)¶ Generate memcache key to use to cache request data
-
influxgraph.utils.
gen_memcache_pattern_key
(pattern)¶ Generate memcache key from pattern
-
influxgraph.utils.
get_aggregation_func
(path, aggregation_functions)¶ Lookup aggregation function for path, if any. Defaults to ‘mean’.
Parameters:
-
influxgraph.utils.
get_retention_policy
(interval, retention_policies)¶ Get appropriate retention policy for interval provided
Parameters: Return type: str
orNone
-
influxgraph.utils.
make_memcache_client
(memcache_host, memcache_max_value=1)¶ Make memcache client if given a memcache host or None
-
influxgraph.utils.
parse_series
(series, fields, graphite_templates, separator='.')¶ Parses series and fields with/without graphite templates and returns built Index
Parameters: and fields. :type graphite_templates: list(tuple) as returned by
influxgraph.templates.parse_influxdb_graphite_templates
Return type: influxgraph.classes.tree.NodeTreeIndex
-
influxgraph.utils.
read_influxdb_values
(influxdb_data, paths, measurement_data)¶ Return metric path -> datapoints dict for values from InfluxDB data