Does'nt report the timer values in the influx
Hi,
I am using the influx reporter when I run timer function there insertion in record with time but all the values are null, I can see mean value of the function using getmean() but there is no reflection of the timer values in influx DB. The code I am using is given below
reporter = InfluxReporter(registry, reporting_interval=1, database='mydatabase', server='myserver.local', username='myusername', password='mypassword', port='8186')
reporter.start()
time1 = registry.timer("func1_calls")
# def testTimer():
# with timer("test").time():
# print("I am from with statement")
# print(timer("test").get_mean())
# reporter.report_now()
@time_calls
def func1():
print("Hey! I am from function 1")
while True:
time.sleep(1)
func1()

I haven't used this reporter myself. Feel free to offer a pull request with a fix and I'll gladly merge it
A quick change in Timer Documentation instead of test_calls it should be just alias name when you are using with statement
from time import sleep
from pyformance import timer
with timer("test").time():
sleep(0.1)
print(timer("test").get_mean())
Output: 0.10001015663146973
Your InfluxReporter is passing a registry to the constructor but the measured code is not creating timers from this registry.
Since you explicitly created a timer in this registry
time1 = registry.timer("func1_calls")
but never timed anything against this, the "func1_calls" timer in registry will always have 0 values.
If you use the with style and reference a timer from the registry it will work:
` from time import sleep
from pyformance import timer
with registry.timer("test").time():
sleep(0.1)
print(registry.timer("test").get_mean())`
Thanks :+1: @bitchkat