Comments (3)
- store the
count
andtotal
(and other stats) in astats
key: - store
max
andmin
{
timestamp_hour: ISODate("2013-10-10T23:00:00.000Z"),
type: “memory_used”,
values: [
[ 999999, 999999, …, 1000000 ],
[ 2000000, 2000000, …, 1000000 ],
…,
[ 1600000, 1200000, …, 1100000 ],
[ 1300000, 1400000, …, 1500000 ]
],
stats: [
[ count, total, min, max], // Minute 0
[ count, total, min, max], // Minute 1
// ....
],
count: 0,
total: 0,
min: 0,
max: 0
}
from cobra.
Benchmarking
- 1000 sensors per second.
Before (using subdocument schema)
After (using array schema)
- Before implementing
$max
and$min
from cobra.
I notice that the min
field is not getting set, because BSON comparison order puts null
as less than a number. Instead of storing it in the order of [count, total, min, max]
, store it as [count, total, max, min]
where min
is empty by default, not null
, such that on insert/default it is [0,0,0]
for [count,total,max,min]
and the $min
update modifier will detect that the 3rd index is missing and initialize it with the minimum value.
from cobra.
Related Issues (4)
- Cubism graphing HOT 3
- Switch to using setOnInsert HOT 3
- Use Redis to check for pending insert HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cobra.