You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I can go STATS.status_code[200] += 1, but what I really want to do is have a default dictionary of meters so I could do STATS.status_code[200].mark(), but MeterStatDict doesn't seem to be anything like IntDictStat.
Can somebody explain/document the thoughts behind some of these data structures?
p.s. you guys going to py con? I'd love to meet up.
The text was updated successfully, but these errors were encountered:
From looking at the code -- and I didn't write this part, so don't quote me on this -- it looks like MeterStatDict is part of the internal workings of MeterStat, and not meant to be used directly. The best workaround I can think of here is to create a bunch of MeterStats, one for each HTTP status code. I'm sure there's a way to do this automatically (see "Class Stats" in the readme for my best guess as to how), but there's a lot of magic in the scales internals, and I forget how most of it works.
If you do end up making something like a default dictionary of meters, that would be really cool.
That sounds reasonable; just adding the leading underscore could help. Of course, there are a bunch of other classes whose names could use changing like that, such as IntDict, which is internal to IntDictStat.
In general, I wish that scales had more documentation. It's also due for a code cleanup one of these days.
This is mainly about naming things, but tell me if I'm way wrong on this.
So I have the following stats:
I can go STATS.status_code[200] += 1, but what I really want to do is have a default dictionary of meters so I could do STATS.status_code[200].mark(), but MeterStatDict doesn't seem to be anything like IntDictStat.
Can somebody explain/document the thoughts behind some of these data structures?
p.s. you guys going to py con? I'd love to meet up.
The text was updated successfully, but these errors were encountered: