# A simple way to get more value from metrics

DevFeed: [A simple way to get more value from metrics](<https://devfeed.tech/articles/a-simple-way-to-get-more-value-from-metrics-77721.md>)

Original publisher: [Read original article](<https://danluu.com/metrics-analytics/>)

Published: 2020-05-30T07:06:34Z

Content type: article

Language: en

Sources: [Danluu](<https://devfeed.tech/sources/danluu.md>)

Topics: [observability](<https://devfeed.tech/topics/observability.md>), [compressing data with Parquet](<https://devfeed.tech/topics/compressing-data-with-parquet.md>), [Prometheus](<https://devfeed.tech/topics/prometheus.md>)

Tags: [cost](<https://devfeed.tech/tags/cost.md>), [infra](<https://devfeed.tech/tags/infra.md>), [metrics](<https://devfeed.tech/tags/metrics.md>), [optimization](<https://devfeed.tech/tags/optimization.md>), [performance](<https://devfeed.tech/tags/performance.md>)

## AI overview

The article describes LongTermMetrics, a batch system for querying historical metrics across services and hosts. It explains how the system stores selected performance and capacity data in Parquet on HDFS to enable SQL analysis, and discusses its applications, design choices, operational tradeoffs, and implementation mistakes.

## Source excerpt

We spent one day1 building a system that immediately found a mid 7 figure optimization (which ended up shipping). In the first year, we shipped mid 8 figures per year worth of cost savings as a result. The key feature this system introduces is the ability to query metrics data across all hosts and all services and over any period of time (since inception), so we've called it LongTermMetrics (LTM) internally since I like boring, descriptive, names. This got started when I was looking for a starter project that would both help me understand the Twitter infra stack and also have some easily quantifiable value. Andy Wilcox suggested looking at JVM survivor space utilization for some large services. If you're not familiar with what survivor space is, you can think of it as a configurable, fixed-size buffer, in the JVM (at least if you use the GC algorithm that's default at Twitter). At the time, if you looked at a random large services, you'd usually find that either: The buffer was too small, resulting in poor performance, sometimes catastrophically poor when under high load. The buffer was too large, resulting in wasted memory, i.e., wasted money. But instead of looking at random services, there's no fundamental reason that we shouldn't be able to query all services and get a list of which services have room for improvement in their configuration, sorted by performance degradation or cost savings. And if we write that query for JVM survivor space, this also goes for other configuration parameters (e.g., other JVM parameters, CPU quota, memory quota, etc.). Writing a query that worked for all the services turned out to be a little more difficult than I was hoping due to a combination of data consistency and performance issues. Data consistency issues included things like: Any given metric can have ~100 names, e.g., I found 94 different names for JVM survivor space I suspect there are more, these were just the ones I could find via a simple search The same metric name mi