Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Use Python syntax highlighting in the readme file.

  • Loading branch information...
commit 28fea82c53d55f864fb135a3d7068d4f04d982d6 1 parent 80c4023
Artur Dryomov authored December 16, 2012

Showing 1 changed file with 27 additions and 9 deletions. Show diff stats Hide diff stats

  1. 36  README.rst
36  README.rst
Source Rendered
@@ -19,7 +19,9 @@ API
19 19
 Gauge
20 20
 -----
21 21
 
22  
-A gauge is an instantaneous measurement of a value ::
  22
+A gauge is an instantaneous measurement of a value
  23
+
  24
+.. code-block:: python
23 25
 
24 26
     class JobGauge(metrology.instruments.Gauge):
25 27
         def value(self):
@@ -30,7 +32,9 @@ A gauge is an instantaneous measurement of a value ::
30 32
 Counters
31 33
 --------
32 34
 
33  
-A counter is like a gauge, but you can increment or decrement its value ::
  35
+A counter is like a gauge, but you can increment or decrement its value
  36
+
  37
+.. code-block:: python
34 38
 
35 39
     counter = Metrology.counter('pending-jobs')
36 40
     counter.increment()
@@ -41,7 +45,9 @@ Meters
41 45
 ------
42 46
 
43 47
 A meter measures the rate of events over time (e.g., "requests per second").
44  
-In addition to the mean rate, you can also track 1, 5 and 15 minutes moving averages ::
  48
+In addition to the mean rate, you can also track 1, 5 and 15 minutes moving averages
  49
+
  50
+.. code-block:: python
45 51
 
46 52
     meter = Metrology.meter('requests')
47 53
     meter.mark()
@@ -50,7 +56,9 @@ In addition to the mean rate, you can also track 1, 5 and 15 minutes moving aver
50 56
 Timers
51 57
 ------
52 58
 
53  
-A timer measures both the rate that a particular piece of code is called and the distribution of its duration ::
  59
+A timer measures both the rate that a particular piece of code is called and the distribution of its duration
  60
+
  61
+.. code-block:: python
54 62
 
55 63
     timer = Metrology.timer('responses')
56 64
     with timer:
@@ -60,8 +68,10 @@ A timer measures both the rate that a particular piece of code is called and the
60 68
 Utilization Timer
61 69
 -----------------
62 70
 
63  
-A specialized timer that calculates the percentage of wall-clock time that was spent ::
  71
+A specialized timer that calculates the percentage of wall-clock time that was spent
64 72
     
  73
+.. code-block:: python
  74
+
65 75
     utimer = Metrology.utilization_timer('responses')
66 76
     with utimer:
67 77
       do_something()
@@ -69,7 +79,9 @@ A specialized timer that calculates the percentage of wall-clock time that was s
69 79
 Profilers
70 80
 ---------
71 81
 
72  
-A profiler measures the distribution of the duration passed in a every part of the code ::
  82
+A profiler measures the distribution of the duration passed in a every part of the code
  83
+
  84
+.. code-block:: python
73 85
 
74 86
     profiler = Metrology.profiler('slow-code')
75 87
     with profiler:
@@ -82,7 +94,9 @@ Reporters
82 94
 Logger Reporter
83 95
 ---------------
84 96
 
85  
-A logging reporter that write metrics to a logger ::
  97
+A logging reporter that write metrics to a logger
  98
+
  99
+.. code-block:: python
86 100
 
87 101
     reporter = LoggerReporter(level=logging.INFO, interval=10)
88 102
     reporter.start()
@@ -91,7 +105,9 @@ A logging reporter that write metrics to a logger ::
91 105
 Graphite Reporter
92 106
 -----------------
93 107
 
94  
-A graphite reporter that send metrics to graphite ::
  108
+A graphite reporter that send metrics to graphite
  109
+
  110
+.. code-block:: python
95 111
     
96 112
     reporter = GraphiteReporter('graphite.local', 2003)
97 113
     reporter.start()
@@ -100,7 +116,9 @@ A graphite reporter that send metrics to graphite ::
100 116
 Librato Reporter
101 117
 ----------------
102 118
 
103  
-A librator metric reporter that send metrics to librato API ::
  119
+A librator metric reporter that send metrics to librato API
  120
+
  121
+.. code-block:: python
104 122
 
105 123
     reporter = LibratoReporter("<email>", "<token>")
106 124
     reporter.start()

0 notes on commit 28fea82

Please sign in to comment.
Something went wrong with that request. Please try again.