30 lines
699 B
Text
30 lines
699 B
Text
|
# Aggregate metrics using a Starlark script
|
||
|
[[aggregators.starlark]]
|
||
|
## The Starlark source can be set as a string in this configuration file, or
|
||
|
## by referencing a file containing the script. Only one source or script
|
||
|
## should be set at once.
|
||
|
##
|
||
|
## Source of the Starlark script.
|
||
|
source = '''
|
||
|
state = {}
|
||
|
|
||
|
def add(metric):
|
||
|
state["last"] = metric
|
||
|
|
||
|
def push():
|
||
|
return state.get("last")
|
||
|
|
||
|
def reset():
|
||
|
state.clear()
|
||
|
'''
|
||
|
|
||
|
## File containing a Starlark script.
|
||
|
# script = "/usr/local/bin/myscript.star"
|
||
|
|
||
|
## The constants of the Starlark script.
|
||
|
# [aggregators.starlark.constants]
|
||
|
# max_size = 10
|
||
|
# threshold = 0.75
|
||
|
# default_name = "Julia"
|
||
|
# debug_mode = true
|