SlideShare uma empresa Scribd logo
1 de 24
When In Doubt, Graph It Out
Agenda

»Why should we graph data?
»Overview of Graphite
»Shell script example
»Java example
»Additional tools
Why should we graph stuff?
Alternatives to Graphite
Log files
DEBUG [01-Mar-12 10:36:03] [pool-10-thread-2] com.pronto.sem.manager.impl.BidManagerImpl    :Updated keyword bid for: 1201584957-8316815-0_mbs

DEBUG [01-Mar-12 10:36:03] [pool-10-thread-1] com.pronto.sem.manager.impl.BidManagerImpl    :Updated keyword bid for: 1306883462-9748970-0-o_mes

DEBUG [01-Mar-12 10:36:03] [pool-10-thread-3] com.pronto.sem.manager.impl.BidManagerImpl    :Updated keyword bid for: 1284651005-4763277-0-8-bmx_mes

DEBUG [01-Mar-12 10:36:03] [pool-10-thread-2] com.pronto.sem.manager.impl.BidManagerImpl    :Updated keyword bid for: 1196567997-8624786d-0_mes

DEBUG [01-Mar-12 10:36:03] [pool-10-thread-3] com.pronto.sem.manager.impl.BidManagerImpl    :Updated keyword bid for: 1284649502-3873052-80503-
bmx_mes

DEBUG [01-Mar-12 10:36:03] [pool-10-thread-2] com.pronto.sem.manager.impl.BidManagerImpl    :Updated keyword bid for: 1211339455-1237643d-0_mps

DEBUG [01-Mar-12 10:36:03] [pool-10-thread-1] com.pronto.sem.manager.impl.BidManagerImpl    :Updated keyword bid for: 1300850840-2087124-0-p_mbs

DEBUG [01-Mar-12 10:36:03] [pool-10-thread-1] com.pronto.sem.manager.impl.BidManagerImpl    :Updated keyword bid for: 1294954750-9188506-0-p_mes

DEBUG [01-Mar-12 10:36:03] [pool-10-thread-2] com.pronto.sem.manager.impl.BidManagerImpl    :Updated keyword bid for: 1196873161-5673618d-0_mps

DEBUG [01-Mar-12 10:36:03] [pool-10-thread-2] com.pronto.sem.manager.impl.BidManagerImpl    :Updated keyword bid for: 1257526947-2361816-0_mps

DEBUG [01-Mar-12 10:36:03] [pool-10-thread-2] com.pronto.sem.job.BidUpdateRunnable    :Processed Row[1700]

DEBUG [01-Mar-12 10:36:03] [pool-11-thread-1] com.pronto.sem.manager.impl.BidManagerImpl    :Updated keyword bid for: 1296091717-9634933-0-md_ys

DEBUG [01-Mar-12 10:36:03] [pool-11-thread-3] com.pronto.sem.manager.impl.BidManagerImpl    :Updated keyword bid for: 1292018269-8694964-0-md_ys

DEBUG [01-Mar-12 10:36:04] [pool-10-thread-2] com.pronto.sem.manager.impl.BidManagerImpl    :Updated keyword bid for: 1189412336-672954-0_mes

DEBUG [01-Mar-12 10:36:04] [pool-10-thread-1] com.pronto.sem.manager.impl.BidManagerImpl    :Updated keyword bid for: 1196829650-9210295d-0-p_mes

DEBUG [01-Mar-12 10:36:04] [pool-11-thread-2] com.pronto.sem.manager.impl.BidManagerImpl    :Updated keyword bid for: 1299102528-4698537-0-md_ys

DEBUG [01-Mar-12 10:36:04] [pool-10-thread-1] com.pronto.sem.manager.impl.BidManagerImpl    :Updated keyword bid for: 1295153899-6527254-0-p_mes

DEBUG [01-Mar-12 10:36:04] [pool-10-thread-2] com.pronto.sem.manager.impl.BidManagerImpl    :Updated keyword bid for: 1257523345-7680668-0_mbs

DEBUG [01-Mar-12 10:36:04] [pool-10-thread-3] com.pronto.sem.manager.impl.BidManagerImpl    :Updated keyword bid for: 1191889434-6754217-0_mps

DEBUG [01-Mar-12 10:36:04] [pool-10-thread-1] com.pronto.sem.manager.impl.BidManagerImpl    :Updated keyword bid for: 1292858452-5997889-0-p_mps
Cacti (http://report01/dashboard/)
Enough talk.


What is this Graphite you speak of?
http://graphite101/
How do we get data into Graphite?



»telnet to port 2003

»Enter 3 values
metric.name value unixtime
Example in bash
#!/bin/bash

# Set this hostname
HOSTNAME=`/bin/hostname --short`

# Set Graphite host
GRAPHITE=graphite101
GRAPHITE_PORT=2003

# Get epoch
DATE=`/bin/date +%s`

# Collect some data
MY_DATA=`/usr/sbin/lsof -u tomcat | /usr/bin/wc -l`

# Send data to Graphite
echo "stats.${HOSTNAME}.file_handle.count ${MY_DATA} ${DATE}" | /usr/bin/nc $GRAPHITE $GRAPHITE_PORT
Example in Java
import java.io.OutputStreamWriter;
import java.io.Writer;
import java.net.Socket;


public class GraphiteLogger {

    private static String GRAPHITE_HOST = "graphite101";
    private static int GRAPHITE_PORT    = 2003;

    public static void logToGraphite(String metric, int value) throws Exception {

        Long timeInSeconds = System.currentTimeMillis() / 1000;

        Socket socket = new Socket(GRAPHITE_HOST, GRAPHITE_PORT);

        try {
            Writer writer = new OutputStreamWriter(socket.getOutputStream());
            writer.write(metric + " " + value + " " + timeInSeconds + "n");
            writer.flush();
            writer.close();
        } finally {
            socket.close();
        }
    }

    public static void main(String[]args) throws Exception {
        GraphiteLogger.logToGraphite("stats.test.example.count", 100);
    }
}
Where is data stored?




/opt/graphite/storage/whisper
Other tools
logster
StatsD
graphitejs
graphios
jmxtrans
For more information



http://graphite.readthedocs.org/en/1.0/index.html

Mais conteúdo relacionado

Mais procurados

Using PyPy instead of Python for speed
Using PyPy instead of Python for speedUsing PyPy instead of Python for speed
Using PyPy instead of Python for speedEnplore AB
 
BigQuery implementation
BigQuery implementationBigQuery implementation
BigQuery implementationSimon Su
 
Weather of the Century: Design and Performance
Weather of the Century: Design and PerformanceWeather of the Century: Design and Performance
Weather of the Century: Design and PerformanceMongoDB
 
The Weather of the Century Part 2: High Performance
The Weather of the Century Part 2: High PerformanceThe Weather of the Century Part 2: High Performance
The Weather of the Century Part 2: High PerformanceMongoDB
 
RDO hangout on gnocchi
RDO hangout on gnocchiRDO hangout on gnocchi
RDO hangout on gnocchiEoghan Glynn
 
Collecting metrics with Graphite and StatsD
Collecting metrics with Graphite and StatsDCollecting metrics with Graphite and StatsD
Collecting metrics with Graphite and StatsDitnig
 
Time zones in JavaScript
Time zones in JavaScriptTime zones in JavaScript
Time zones in JavaScriptAdam Hodowany
 
20181025_pgconfeu_lt_gstorefdw
20181025_pgconfeu_lt_gstorefdw20181025_pgconfeu_lt_gstorefdw
20181025_pgconfeu_lt_gstorefdwKohei KaiGai
 
Storing metrics at scale with Gnocchi
Storing metrics at scale with GnocchiStoring metrics at scale with Gnocchi
Storing metrics at scale with GnocchiGordon Chung
 
The Weather of the Century
The Weather of the CenturyThe Weather of the Century
The Weather of the CenturyMongoDB
 
Gmails Quota Secrets
Gmails Quota SecretsGmails Quota Secrets
Gmails Quota SecretsUri Levanon
 
The Ring programming language version 1.7 book - Part 67 of 196
The Ring programming language version 1.7 book - Part 67 of 196The Ring programming language version 1.7 book - Part 67 of 196
The Ring programming language version 1.7 book - Part 67 of 196Mahmoud Samir Fayed
 
The Weather of the Century Part 3: Visualization
The Weather of the Century Part 3: VisualizationThe Weather of the Century Part 3: Visualization
The Weather of the Century Part 3: VisualizationMongoDB
 
app/server monitoring
app/server monitoringapp/server monitoring
app/server monitoringJaemok Jeong
 
Visualising your garbage collection for Node.js
Visualising your garbage collection for Node.jsVisualising your garbage collection for Node.js
Visualising your garbage collection for Node.jsstalleyj
 
Overprov a tool for cluster overprovisioning detection
Overprov  a tool for cluster overprovisioning detectionOverprov  a tool for cluster overprovisioning detection
Overprov a tool for cluster overprovisioning detectionDel Bao
 

Mais procurados (20)

Using PyPy instead of Python for speed
Using PyPy instead of Python for speedUsing PyPy instead of Python for speed
Using PyPy instead of Python for speed
 
BigQuery implementation
BigQuery implementationBigQuery implementation
BigQuery implementation
 
Weather of the Century: Design and Performance
Weather of the Century: Design and PerformanceWeather of the Century: Design and Performance
Weather of the Century: Design and Performance
 
The Weather of the Century Part 2: High Performance
The Weather of the Century Part 2: High PerformanceThe Weather of the Century Part 2: High Performance
The Weather of the Century Part 2: High Performance
 
RDO hangout on gnocchi
RDO hangout on gnocchiRDO hangout on gnocchi
RDO hangout on gnocchi
 
Collecting metrics with Graphite and StatsD
Collecting metrics with Graphite and StatsDCollecting metrics with Graphite and StatsD
Collecting metrics with Graphite and StatsD
 
Time zones in JavaScript
Time zones in JavaScriptTime zones in JavaScript
Time zones in JavaScript
 
20181025_pgconfeu_lt_gstorefdw
20181025_pgconfeu_lt_gstorefdw20181025_pgconfeu_lt_gstorefdw
20181025_pgconfeu_lt_gstorefdw
 
Storing metrics at scale with Gnocchi
Storing metrics at scale with GnocchiStoring metrics at scale with Gnocchi
Storing metrics at scale with Gnocchi
 
The Weather of the Century
The Weather of the CenturyThe Weather of the Century
The Weather of the Century
 
MapReduce@DirectI
MapReduce@DirectIMapReduce@DirectI
MapReduce@DirectI
 
Gmails Quota Secrets
Gmails Quota SecretsGmails Quota Secrets
Gmails Quota Secrets
 
Ac cuda c_4
Ac cuda c_4Ac cuda c_4
Ac cuda c_4
 
The Ring programming language version 1.7 book - Part 67 of 196
The Ring programming language version 1.7 book - Part 67 of 196The Ring programming language version 1.7 book - Part 67 of 196
The Ring programming language version 1.7 book - Part 67 of 196
 
The Weather of the Century Part 3: Visualization
The Weather of the Century Part 3: VisualizationThe Weather of the Century Part 3: Visualization
The Weather of the Century Part 3: Visualization
 
app/server monitoring
app/server monitoringapp/server monitoring
app/server monitoring
 
Visualising your garbage collection for Node.js
Visualising your garbage collection for Node.jsVisualising your garbage collection for Node.js
Visualising your garbage collection for Node.js
 
Single qubit-gates operations
Single qubit-gates operationsSingle qubit-gates operations
Single qubit-gates operations
 
Overprov a tool for cluster overprovisioning detection
Overprov  a tool for cluster overprovisioning detectionOverprov  a tool for cluster overprovisioning detection
Overprov a tool for cluster overprovisioning detection
 
Google Big Query UDFs
Google Big Query UDFsGoogle Big Query UDFs
Google Big Query UDFs
 

Destaque

Little Ideas Around Us
Little Ideas Around UsLittle Ideas Around Us
Little Ideas Around Usmmnicole
 
Qomo AVclub 2011
Qomo AVclub 2011Qomo AVclub 2011
Qomo AVclub 2011QOMO
 
Детская интерактивная доска KidzBoard
Детская интерактивная доска KidzBoardДетская интерактивная доска KidzBoard
Детская интерактивная доска KidzBoardQOMO
 
Qomo Vodokanal 2012
Qomo Vodokanal 2012Qomo Vodokanal 2012
Qomo Vodokanal 2012QOMO
 
Английский язык. Изучение алфавита
Английский язык. Изучение алфавитаАнглийский язык. Изучение алфавита
Английский язык. Изучение алфавитаQOMO
 
Colunistas - Toon Machine - Design Ambiental
Colunistas - Toon Machine - Design AmbientalColunistas - Toon Machine - Design Ambiental
Colunistas - Toon Machine - Design AmbientalAgenciaNewStyle
 
География. Контурные карты
География. Контурные картыГеография. Контурные карты
География. Контурные картыQOMO
 
Qomo Inavate 2010
Qomo Inavate 2010Qomo Inavate 2010
Qomo Inavate 2010QOMO
 
2 класс, русский язык. Антонимы
2 класс, русский язык. Антонимы2 класс, русский язык. Антонимы
2 класс, русский язык. АнтонимыQOMO
 
Questionnaire
Questionnaire Questionnaire
Questionnaire sana0001
 
Veja.abril.com.br blog-reinaldo-geral-um-pouco-de-elegancia-a-um-ex-admirador-ag
Veja.abril.com.br blog-reinaldo-geral-um-pouco-de-elegancia-a-um-ex-admirador-agVeja.abril.com.br blog-reinaldo-geral-um-pouco-de-elegancia-a-um-ex-admirador-ag
Veja.abril.com.br blog-reinaldo-geral-um-pouco-de-elegancia-a-um-ex-admirador-agGabriel Dos Santos Birkhann
 
Qomo Inavate 08 2010
Qomo Inavate 08 2010Qomo Inavate 08 2010
Qomo Inavate 08 2010QOMO
 
Qomo trinet СПИК 06-2012
Qomo trinet СПИК 06-2012Qomo trinet СПИК 06-2012
Qomo trinet СПИК 06-2012QOMO
 
Fund. cableado v&d capitulo 09
Fund. cableado v&d   capitulo 09Fund. cableado v&d   capitulo 09
Fund. cableado v&d capitulo 09Jair BG
 
Интерактивные планшеты QOMO
Интерактивные планшеты QOMOИнтерактивные планшеты QOMO
Интерактивные планшеты QOMOQOMO
 
Документ-камеры QOMO
Документ-камеры QOMOДокумент-камеры QOMO
Документ-камеры QOMOQOMO
 
Qomo trinet 2011b
Qomo trinet 2011bQomo trinet 2011b
Qomo trinet 2011bQOMO
 

Destaque (20)

Little Ideas Around Us
Little Ideas Around UsLittle Ideas Around Us
Little Ideas Around Us
 
Daniel goleman
Daniel golemanDaniel goleman
Daniel goleman
 
Qomo AVclub 2011
Qomo AVclub 2011Qomo AVclub 2011
Qomo AVclub 2011
 
Детская интерактивная доска KidzBoard
Детская интерактивная доска KidzBoardДетская интерактивная доска KidzBoard
Детская интерактивная доска KidzBoard
 
Qomo Vodokanal 2012
Qomo Vodokanal 2012Qomo Vodokanal 2012
Qomo Vodokanal 2012
 
Английский язык. Изучение алфавита
Английский язык. Изучение алфавитаАнглийский язык. Изучение алфавита
Английский язык. Изучение алфавита
 
Colunistas - Toon Machine - Design Ambiental
Colunistas - Toon Machine - Design AmbientalColunistas - Toon Machine - Design Ambiental
Colunistas - Toon Machine - Design Ambiental
 
География. Контурные карты
География. Контурные картыГеография. Контурные карты
География. Контурные карты
 
Qomo Inavate 2010
Qomo Inavate 2010Qomo Inavate 2010
Qomo Inavate 2010
 
2 класс, русский язык. Антонимы
2 класс, русский язык. Антонимы2 класс, русский язык. Антонимы
2 класс, русский язык. Антонимы
 
Questionnaire
Questionnaire Questionnaire
Questionnaire
 
Veja.abril.com.br blog-reinaldo-geral-um-pouco-de-elegancia-a-um-ex-admirador-ag
Veja.abril.com.br blog-reinaldo-geral-um-pouco-de-elegancia-a-um-ex-admirador-agVeja.abril.com.br blog-reinaldo-geral-um-pouco-de-elegancia-a-um-ex-admirador-ag
Veja.abril.com.br blog-reinaldo-geral-um-pouco-de-elegancia-a-um-ex-admirador-ag
 
Qomo Inavate 08 2010
Qomo Inavate 08 2010Qomo Inavate 08 2010
Qomo Inavate 08 2010
 
Qomo trinet СПИК 06-2012
Qomo trinet СПИК 06-2012Qomo trinet СПИК 06-2012
Qomo trinet СПИК 06-2012
 
Motores de Busqueda
Motores de Busqueda Motores de Busqueda
Motores de Busqueda
 
Fund. cableado v&d capitulo 09
Fund. cableado v&d   capitulo 09Fund. cableado v&d   capitulo 09
Fund. cableado v&d capitulo 09
 
Интерактивные планшеты QOMO
Интерактивные планшеты QOMOИнтерактивные планшеты QOMO
Интерактивные планшеты QOMO
 
Документ-камеры QOMO
Документ-камеры QOMOДокумент-камеры QOMO
Документ-камеры QOMO
 
Qomo trinet 2011b
Qomo trinet 2011bQomo trinet 2011b
Qomo trinet 2011b
 
Humanidades
HumanidadesHumanidades
Humanidades
 

Semelhante a Graphite

Become a Garbage Collection Hero
Become a Garbage Collection HeroBecome a Garbage Collection Hero
Become a Garbage Collection HeroTier1app
 
Altitude San Francisco 2018: Logging at the Edge
Altitude San Francisco 2018: Logging at the Edge Altitude San Francisco 2018: Logging at the Edge
Altitude San Francisco 2018: Logging at the Edge Fastly
 
"Taster Slides" for Most advanced GTM implementation
"Taster Slides" for Most advanced GTM implementation"Taster Slides" for Most advanced GTM implementation
"Taster Slides" for Most advanced GTM implementationPhil Pearce
 
OPTIMIZING THE TICK STACK
OPTIMIZING THE TICK STACKOPTIMIZING THE TICK STACK
OPTIMIZING THE TICK STACKInfluxData
 
20171206 PGconf.ASIA LT gstore_fdw
20171206 PGconf.ASIA LT gstore_fdw20171206 PGconf.ASIA LT gstore_fdw
20171206 PGconf.ASIA LT gstore_fdwKohei KaiGai
 
Recent Changes and Challenges for Future Presto
Recent Changes and Challenges for Future PrestoRecent Changes and Challenges for Future Presto
Recent Changes and Challenges for Future PrestoKai Sasaki
 
M|18 Real-time Analytics with the New Streaming Data Adapters
M|18 Real-time Analytics with the New Streaming Data AdaptersM|18 Real-time Analytics with the New Streaming Data Adapters
M|18 Real-time Analytics with the New Streaming Data AdaptersMariaDB plc
 
OLTP+OLAP=HTAP
 OLTP+OLAP=HTAP OLTP+OLAP=HTAP
OLTP+OLAP=HTAPEDB
 
Planet-HTML5-Game-Engine Javascript Performance Enhancement
Planet-HTML5-Game-Engine Javascript Performance EnhancementPlanet-HTML5-Game-Engine Javascript Performance Enhancement
Planet-HTML5-Game-Engine Javascript Performance Enhancementup2soul
 
Self scaling Multi cloud nomad workloads
Self scaling Multi cloud nomad workloadsSelf scaling Multi cloud nomad workloads
Self scaling Multi cloud nomad workloadsBram Vogelaar
 
20181016_pgconfeu_ssd2gpu_multi
20181016_pgconfeu_ssd2gpu_multi20181016_pgconfeu_ssd2gpu_multi
20181016_pgconfeu_ssd2gpu_multiKohei KaiGai
 
Small pieces loosely joined
Small pieces loosely joinedSmall pieces loosely joined
Small pieces loosely joinedennui2342
 
Become a Java GC Hero - All Day Devops
Become a Java GC Hero - All Day DevopsBecome a Java GC Hero - All Day Devops
Become a Java GC Hero - All Day DevopsTier1app
 
Dangerous on ClickHouse in 30 minutes, by Robert Hodges, Altinity CEO
Dangerous on ClickHouse in 30 minutes, by Robert Hodges, Altinity CEODangerous on ClickHouse in 30 minutes, by Robert Hodges, Altinity CEO
Dangerous on ClickHouse in 30 minutes, by Robert Hodges, Altinity CEOAltinity Ltd
 
Performance Optimization of Rails Applications
Performance Optimization of Rails ApplicationsPerformance Optimization of Rails Applications
Performance Optimization of Rails ApplicationsSerge Smetana
 
Practical Graph Algorithms with Neo4j
Practical Graph Algorithms with Neo4jPractical Graph Algorithms with Neo4j
Practical Graph Algorithms with Neo4jjexp
 
PL/CUDA - Fusion of HPC Grade Power with In-Database Analytics
PL/CUDA - Fusion of HPC Grade Power with In-Database AnalyticsPL/CUDA - Fusion of HPC Grade Power with In-Database Analytics
PL/CUDA - Fusion of HPC Grade Power with In-Database AnalyticsKohei KaiGai
 
Precomputing recommendations with Apache Beam
Precomputing recommendations with Apache BeamPrecomputing recommendations with Apache Beam
Precomputing recommendations with Apache BeamTatiana Al-Chueyr
 
Advanced Query Optimizer Tuning and Analysis
Advanced Query Optimizer Tuning and AnalysisAdvanced Query Optimizer Tuning and Analysis
Advanced Query Optimizer Tuning and AnalysisMYXPLAIN
 
Matúš Cimerman: Building AI data pipelines using PySpark, PyData Bratislava M...
Matúš Cimerman: Building AI data pipelines using PySpark, PyData Bratislava M...Matúš Cimerman: Building AI data pipelines using PySpark, PyData Bratislava M...
Matúš Cimerman: Building AI data pipelines using PySpark, PyData Bratislava M...GapData Institute
 

Semelhante a Graphite (20)

Become a Garbage Collection Hero
Become a Garbage Collection HeroBecome a Garbage Collection Hero
Become a Garbage Collection Hero
 
Altitude San Francisco 2018: Logging at the Edge
Altitude San Francisco 2018: Logging at the Edge Altitude San Francisco 2018: Logging at the Edge
Altitude San Francisco 2018: Logging at the Edge
 
"Taster Slides" for Most advanced GTM implementation
"Taster Slides" for Most advanced GTM implementation"Taster Slides" for Most advanced GTM implementation
"Taster Slides" for Most advanced GTM implementation
 
OPTIMIZING THE TICK STACK
OPTIMIZING THE TICK STACKOPTIMIZING THE TICK STACK
OPTIMIZING THE TICK STACK
 
20171206 PGconf.ASIA LT gstore_fdw
20171206 PGconf.ASIA LT gstore_fdw20171206 PGconf.ASIA LT gstore_fdw
20171206 PGconf.ASIA LT gstore_fdw
 
Recent Changes and Challenges for Future Presto
Recent Changes and Challenges for Future PrestoRecent Changes and Challenges for Future Presto
Recent Changes and Challenges for Future Presto
 
M|18 Real-time Analytics with the New Streaming Data Adapters
M|18 Real-time Analytics with the New Streaming Data AdaptersM|18 Real-time Analytics with the New Streaming Data Adapters
M|18 Real-time Analytics with the New Streaming Data Adapters
 
OLTP+OLAP=HTAP
 OLTP+OLAP=HTAP OLTP+OLAP=HTAP
OLTP+OLAP=HTAP
 
Planet-HTML5-Game-Engine Javascript Performance Enhancement
Planet-HTML5-Game-Engine Javascript Performance EnhancementPlanet-HTML5-Game-Engine Javascript Performance Enhancement
Planet-HTML5-Game-Engine Javascript Performance Enhancement
 
Self scaling Multi cloud nomad workloads
Self scaling Multi cloud nomad workloadsSelf scaling Multi cloud nomad workloads
Self scaling Multi cloud nomad workloads
 
20181016_pgconfeu_ssd2gpu_multi
20181016_pgconfeu_ssd2gpu_multi20181016_pgconfeu_ssd2gpu_multi
20181016_pgconfeu_ssd2gpu_multi
 
Small pieces loosely joined
Small pieces loosely joinedSmall pieces loosely joined
Small pieces loosely joined
 
Become a Java GC Hero - All Day Devops
Become a Java GC Hero - All Day DevopsBecome a Java GC Hero - All Day Devops
Become a Java GC Hero - All Day Devops
 
Dangerous on ClickHouse in 30 minutes, by Robert Hodges, Altinity CEO
Dangerous on ClickHouse in 30 minutes, by Robert Hodges, Altinity CEODangerous on ClickHouse in 30 minutes, by Robert Hodges, Altinity CEO
Dangerous on ClickHouse in 30 minutes, by Robert Hodges, Altinity CEO
 
Performance Optimization of Rails Applications
Performance Optimization of Rails ApplicationsPerformance Optimization of Rails Applications
Performance Optimization of Rails Applications
 
Practical Graph Algorithms with Neo4j
Practical Graph Algorithms with Neo4jPractical Graph Algorithms with Neo4j
Practical Graph Algorithms with Neo4j
 
PL/CUDA - Fusion of HPC Grade Power with In-Database Analytics
PL/CUDA - Fusion of HPC Grade Power with In-Database AnalyticsPL/CUDA - Fusion of HPC Grade Power with In-Database Analytics
PL/CUDA - Fusion of HPC Grade Power with In-Database Analytics
 
Precomputing recommendations with Apache Beam
Precomputing recommendations with Apache BeamPrecomputing recommendations with Apache Beam
Precomputing recommendations with Apache Beam
 
Advanced Query Optimizer Tuning and Analysis
Advanced Query Optimizer Tuning and AnalysisAdvanced Query Optimizer Tuning and Analysis
Advanced Query Optimizer Tuning and Analysis
 
Matúš Cimerman: Building AI data pipelines using PySpark, PyData Bratislava M...
Matúš Cimerman: Building AI data pipelines using PySpark, PyData Bratislava M...Matúš Cimerman: Building AI data pipelines using PySpark, PyData Bratislava M...
Matúš Cimerman: Building AI data pipelines using PySpark, PyData Bratislava M...
 

Graphite

  • 1. When In Doubt, Graph It Out
  • 2. Agenda »Why should we graph data? »Overview of Graphite »Shell script example »Java example »Additional tools
  • 3. Why should we graph stuff?
  • 4.
  • 5.
  • 6.
  • 8. Log files DEBUG [01-Mar-12 10:36:03] [pool-10-thread-2] com.pronto.sem.manager.impl.BidManagerImpl :Updated keyword bid for: 1201584957-8316815-0_mbs DEBUG [01-Mar-12 10:36:03] [pool-10-thread-1] com.pronto.sem.manager.impl.BidManagerImpl :Updated keyword bid for: 1306883462-9748970-0-o_mes DEBUG [01-Mar-12 10:36:03] [pool-10-thread-3] com.pronto.sem.manager.impl.BidManagerImpl :Updated keyword bid for: 1284651005-4763277-0-8-bmx_mes DEBUG [01-Mar-12 10:36:03] [pool-10-thread-2] com.pronto.sem.manager.impl.BidManagerImpl :Updated keyword bid for: 1196567997-8624786d-0_mes DEBUG [01-Mar-12 10:36:03] [pool-10-thread-3] com.pronto.sem.manager.impl.BidManagerImpl :Updated keyword bid for: 1284649502-3873052-80503- bmx_mes DEBUG [01-Mar-12 10:36:03] [pool-10-thread-2] com.pronto.sem.manager.impl.BidManagerImpl :Updated keyword bid for: 1211339455-1237643d-0_mps DEBUG [01-Mar-12 10:36:03] [pool-10-thread-1] com.pronto.sem.manager.impl.BidManagerImpl :Updated keyword bid for: 1300850840-2087124-0-p_mbs DEBUG [01-Mar-12 10:36:03] [pool-10-thread-1] com.pronto.sem.manager.impl.BidManagerImpl :Updated keyword bid for: 1294954750-9188506-0-p_mes DEBUG [01-Mar-12 10:36:03] [pool-10-thread-2] com.pronto.sem.manager.impl.BidManagerImpl :Updated keyword bid for: 1196873161-5673618d-0_mps DEBUG [01-Mar-12 10:36:03] [pool-10-thread-2] com.pronto.sem.manager.impl.BidManagerImpl :Updated keyword bid for: 1257526947-2361816-0_mps DEBUG [01-Mar-12 10:36:03] [pool-10-thread-2] com.pronto.sem.job.BidUpdateRunnable :Processed Row[1700] DEBUG [01-Mar-12 10:36:03] [pool-11-thread-1] com.pronto.sem.manager.impl.BidManagerImpl :Updated keyword bid for: 1296091717-9634933-0-md_ys DEBUG [01-Mar-12 10:36:03] [pool-11-thread-3] com.pronto.sem.manager.impl.BidManagerImpl :Updated keyword bid for: 1292018269-8694964-0-md_ys DEBUG [01-Mar-12 10:36:04] [pool-10-thread-2] com.pronto.sem.manager.impl.BidManagerImpl :Updated keyword bid for: 1189412336-672954-0_mes DEBUG [01-Mar-12 10:36:04] [pool-10-thread-1] com.pronto.sem.manager.impl.BidManagerImpl :Updated keyword bid for: 1196829650-9210295d-0-p_mes DEBUG [01-Mar-12 10:36:04] [pool-11-thread-2] com.pronto.sem.manager.impl.BidManagerImpl :Updated keyword bid for: 1299102528-4698537-0-md_ys DEBUG [01-Mar-12 10:36:04] [pool-10-thread-1] com.pronto.sem.manager.impl.BidManagerImpl :Updated keyword bid for: 1295153899-6527254-0-p_mes DEBUG [01-Mar-12 10:36:04] [pool-10-thread-2] com.pronto.sem.manager.impl.BidManagerImpl :Updated keyword bid for: 1257523345-7680668-0_mbs DEBUG [01-Mar-12 10:36:04] [pool-10-thread-3] com.pronto.sem.manager.impl.BidManagerImpl :Updated keyword bid for: 1191889434-6754217-0_mps DEBUG [01-Mar-12 10:36:04] [pool-10-thread-1] com.pronto.sem.manager.impl.BidManagerImpl :Updated keyword bid for: 1292858452-5997889-0-p_mps
  • 10. Enough talk. What is this Graphite you speak of?
  • 11.
  • 13. How do we get data into Graphite? »telnet to port 2003 »Enter 3 values metric.name value unixtime
  • 14. Example in bash #!/bin/bash # Set this hostname HOSTNAME=`/bin/hostname --short` # Set Graphite host GRAPHITE=graphite101 GRAPHITE_PORT=2003 # Get epoch DATE=`/bin/date +%s` # Collect some data MY_DATA=`/usr/sbin/lsof -u tomcat | /usr/bin/wc -l` # Send data to Graphite echo "stats.${HOSTNAME}.file_handle.count ${MY_DATA} ${DATE}" | /usr/bin/nc $GRAPHITE $GRAPHITE_PORT
  • 15. Example in Java import java.io.OutputStreamWriter; import java.io.Writer; import java.net.Socket; public class GraphiteLogger { private static String GRAPHITE_HOST = "graphite101"; private static int GRAPHITE_PORT = 2003; public static void logToGraphite(String metric, int value) throws Exception { Long timeInSeconds = System.currentTimeMillis() / 1000; Socket socket = new Socket(GRAPHITE_HOST, GRAPHITE_PORT); try { Writer writer = new OutputStreamWriter(socket.getOutputStream()); writer.write(metric + " " + value + " " + timeInSeconds + "n"); writer.flush(); writer.close(); } finally { socket.close(); } } public static void main(String[]args) throws Exception { GraphiteLogger.logToGraphite("stats.test.example.count", 100); } }
  • 16. Where is data stored? /opt/graphite/storage/whisper
  • 20.