-
Notifications
You must be signed in to change notification settings - Fork 0
/
stats.py
executable file
·33 lines (25 loc) · 1.03 KB
/
stats.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/usr/bin/env python
import pymongo
import time
from collections import defaultdict
import numpy as np
client = pymongo.MongoClient('atlas.lan:27017',
username='poe',
password='poe',
authSource='admin')
db = client.path_of_exile_dev
total_items = db.items.count_documents({})
print(f" Total Items: {total_items:,d}")
total_stashes = db.stashes.count_documents({})
print(f"Total Stashes: {total_stashes:,d}")
print(f" Items/Stash: {total_items/total_stashes:,.3f}")
stash_item_counts = []
for stash in db.stashes.find():
stash_item_counts.append(len(stash['items']))
stash_item_counts = np.asarray(stash_item_counts)
print(f" Max Items: {stash_item_counts.max()}")
print(f" Median Items: {np.median(stash_item_counts)}")
print(f" 5th Per: {np.percentile(stash_item_counts,5)}")
print(f" 25th Per: {np.percentile(stash_item_counts,25)}")
print(f" 75th Per: {np.percentile(stash_item_counts,75)}")
print(f" 95th Per: {np.percentile(stash_item_counts,95)}")