Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

in memory database #5

Open
Geal opened this issue Aug 27, 2018 · 0 comments
Open

in memory database #5

Geal opened this issue Aug 27, 2018 · 0 comments

Comments

@Geal
Copy link
Owner

Geal commented Aug 27, 2018

Right now, the metrics are stored in a very naive way:

pub struct Metrics {
  series: HashMap<String, Serie>,
  counter: usize,
}

pub struct Serie {            
  pub metric_type: MetricType,
  pub values: Vec<Value>,           
}

pub struct Value {                                                                        
  pub timestamp: Timespec,
  pub tags:  Vec<Tag>,
  pub value: isize,
}

pub struct Tag {
  pub key:   String,
  pub value: String,
}

pub enum MetricType {
  Counter,
  Timing,
  Gauge,
}

This is fine for debug sessions and demos, but if the server runs for some time, memory usage gets high.

What can be done here? I remember some people were working on in memory column databases:
https://www.reddit.com/r/rust/comments/93ikxz/emulating_japlkdb_take_2_how_store_columnar_data/
https://crates.io/crates/column

Maybe we can reuse something here?

This should help with #3 and #4 (to do complex queries, we need a database that supports it)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant