mirror of
https://github.com/Infinidat/infi.clickhouse_orm.git
synced 2024-11-22 00:56:34 +03:00
Update example in README
This commit is contained in:
parent
639867bb32
commit
5db4f113ac
|
@ -50,7 +50,7 @@ busy = CPUStats.objects_in(db).filter(cpu_id=1, cpu_percent__gt=95).count()
|
|||
print 'CPU 1 was busy {:.2f}% of the time'.format(busy * 100.0 / total)
|
||||
|
||||
# Calculate the average usage per CPU
|
||||
for row in db.select('SELECT cpu_id, avg(cpu_percent) AS average FROM demo.cpustats GROUP BY cpu_id'):
|
||||
for row in CPUStats.objects_in(db).aggregate('cpu_id', average='avg(cpu_percent)'):
|
||||
print 'CPU {row.cpu_id}: {row.average:.2f}%'.format(row=row)
|
||||
```
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user