Code Monkey home page Code Monkey logo

django-statsy's People

Contributors

ayumukasuga avatar bitdeli-chef avatar jpic avatar waffle-iron avatar zhebrak avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

django-statsy's Issues

Using uWSGI's spooler or rq instead of Celery

Hello! I would like to use uWSGI spooler for async tasks.
It can be almost the same as tasks.py:

from django_uwsgi.decorators import spool
from statsy.models import StatsyObject


@spool
def send(**kwargs):
    obj = StatsyObject.create(**kwargs)

    return obj.serialize()


@spool
def send_callback(result, callback_path):
    module, callback = callback_path.rsplit('.', 1)
    module = importlib.import_module(module)
    callback = getattr(module, callback)

    return callback(result)

but file name can be smth like spooler.py or smth like that.
and then in uwsgi.ini:

spooler = spooler
spooler-import = statsy.spooler

just needed some workaround to switch between celery and spooler(or even rq can be added) in core.py:

send_task.spool(kwargs=self._clean_kwargs_async(kwargs), link=callback)

personally I prefer not to use celery when there's not so lots of tasks, and since I deploy ьн project via uwsgi, I can use uwsgi's spooler and don't need to install and setup huge celery.

Search query language

Visual blocks or sql-like.

group='group_name' and event='event_name'

or

group_1
group_2 (x)

event_1 (x)
event_2

label_1
label_2
label_3

Fixed dependency for python-dateutil

Hi, I'm interested in using django-statsy in my Django project and I would like to try it. After adding it
to my requirements, I've problems to resolve my dependencies, because the version of python-dateutil is fixed here:

python-dateutil==2.5.3

Is this still necessary? And since the project has not been updated for some time: Are
there any objections using it with Django 2.2?

Stats API

/stats/today/
/stats/2016.07.13/
/stats/group:event:label/
etc

Cannot make it work. Python 3.5 Django 1.11 'function' object has no attribute 'status_code'

Added @statsy

in my views.py
import statsy # By the way you did not mention about importing it in views in README

@statsy.watch
def filetree(request)
...

In urls.py got
url(r'^$', main.views.filetree, name=")

And have an error

Request Method: GET
http://localhost:8000/
1.11.1
AttributeError
'function' object has no attribute 'status_code'
/home/user/Env/dj_test/lib/python3.5/site-packages/django/middleware/common.py in process_response, line 115
/home/user/Env/dj_test3/bin/python
3.5.2

 

It appears that the "stats_numbers" classmethod in Stats class has the wrong function prototype

I am hesitant to report this as a bug, because I'm not doing anything out of the ordinary with my project, and I would have expected someone else to see this, but it does appear to be a bug.

In the stats.py file, the stats_numbers classmethod has a prototype of:
def stats_numbers(cls, data):

I am seeing an error as follows:
TypeError: stats_numbers() takes exactly 2 arguments (3 given)
from the getattr function call in the classmethod _stats (same file - line 37 in my version).
It also prevents the graph on the stats page from rendering (which makes sense since the server code threw an exception).

Looking at the rest of the stats_* classmethods in the class, they all have an additional input parameter (either period or key) that the stats_numbers method is missing, and the _stats function is definitely calling it with 2 explicit arguments (and 1 implied argument).
I believe the solution is to change the prototype of stats_numbers to as follows:
def stats_numbers(cls, data, period):
and to not use the data provided in the period argument. (Could also name it ignore or something else descriptive).

Anyway, doing this in my environment solved the problem, and the graph renders correctly.

Demo-project

— demo account
— stats population
— docs

Smart aggregation

aggregation label in model (?)

manage.py command with options
aggregation task

aggregate like default month period display: 6 hours (4 * 30 entries)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.