frankwiles / django-app-metrics Goto Github PK
View Code? Open in Web Editor NEWSimple framework for capturing in application metrics and emailing aggregation results
License: BSD 3-Clause "New" or "Revised" License
Simple framework for capturing in application metrics and emailing aggregation results
License: BSD 3-Clause "New" or "Revised" License
It is possible to emulate gauges in Mixpanel by posting the gauge value as a property of a metric and then using the aggregation functions (SUM or AVG) in the segmentation view to graph it.
No big deal to implement that in django-app-metrics and I'd be glad to do it, just wanted to ask if you think the idea is worth pursuing. Looking forward to feedback!
There are some updates I'd like to make e.g. #42, which would require dropping support for unsupported versions of Django.
@frankwiles would you be okay with making a major version update that breaks support for legacy Django? I'll help with PRs.
Installing celery (not especially a trivial task) if you don't need it seems especially onerous. I haven't examined the code but would conditional imports not remove the need for this?
(On a side note - there's often a simpler solution than Celery for many things it's used for - is this aspect of the code pluggable? A simple management command run via cron would be a good alternative for some)
The emails that I receive would make more sense to me if they showed the following:
Would this be useful to others? I'd be happy to code it up if so.
Create a way to store up metrics in shared memory and periodically flush them to the backend removing the need/overhead of celery for extremely high traffic sites.
Does this app allow me to do this or should i just store metric("john_created_object") then rely on the backend to split by "_" and make sense of it?
Hi,
Is there an intention to add Mongodb integration?
Using django-app-metrics in a larger projects that is not otherwise using django-mailer means that the tests fail (they can't even be imported) because of a single use of mailer. Maybe the test can be written to avoid the use of mailer.send_all() or maybe it should be conditional upon the ability to import mailer. As it currently stands, things blow up.
The tests fail for me (Bare virtualenv, Django 1.4.1, python manage.py test
) with connection errors in celery/kombu/amqplib. Is it necessary to have a fully configured celery running?
It would be very helpful to have a short description about the test requirements, alternatively removing as many external dependencies as possible would also be nice :-)
Let me know If I can support you with this!
Test output: https://gist.github.com/3417395
My question is wider than this project context. I integrated my django with Sentry (https://getsentry.com/welcome/), I provided a SECRET_KEY variable in my settings.py. Also in this project "tests/settings.py" have same variable.
When I import "APP_METRICS_BACKEND" from "app_metrics.tests.settings" to config djang-app-metrics. Django faced by this exception: "django.core.exceptions.ImproperlyConfigured: The SECRET_KEY setting must not be empty.".
/a/venvs/venv/lib/python2.6/site-packages/app_metrics/models.pyc in unicode(self)
87 def unicode(self):
88 return "'%s' for week %d of %d" % (self.metric.name,
---> 89 self.created.strftime("%m"))
90
TypeError: %d format: a number is required, not str
I'm using redis-py 2.7.1 (instead of 2.6.2 as listed in requirements), and redis 2.6.7, and I'm getting the following exception:
Task app_metrics.tasks.redis_metric_task[d83b61b0-e35a-4170-902b-97d6e7c5a2f9] raised exception: AttributeError("'StrictRedis' object has no attribute 'incrby'",)
Traceback (most recent call last):
File "/Users/brad/.virtualenvs/wfp-app-metrics/lib/python2.7/site-packages/celery/task/trace.py", line 224, in trace_task
R = retval = fun(*args, **kwargs)
File "/Users/brad/.virtualenvs/wfp-app-metrics/lib/python2.7/site-packages/celery/task/trace.py", line 406, in __protected_call__
return self.run(*args, **kwargs)
File "/Users/brad/django/workforpie/app_metrics/tasks.py", line 161, in redis_metric_task
r.incrby(day_key, num)
AttributeError: 'StrictRedis' object has no attribute 'incrby'
This breaks in tasks/redis_metric_task.py where you increment keys for day, week, month, year:
r.incrby(day_key, num)
It appears that redis-py no longer includes an incrby
method. There's an incrbyfloat
method for float values, but I'm not sure that's what you want either.
Any thoughts on a preferred way to make this work with the current redis-py?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.