MCPcopy
hub / github.com/statsd/statsd / send

Method send

examples/StatsdClient.java:182–203  ·  view source on GitHub ↗
(double sampleRate, String... stats)

Source from the content-addressed store, hash-verified

180 }
181
182 private boolean send(double sampleRate, String... stats) {
183
184 boolean retval = false; // didn't send anything
185 if (sampleRate < 1.0) {
186 for (String stat : stats) {
187 if (RNG.nextDouble() <= sampleRate) {
188 stat = String.format(Locale.ENGLISH, "%s|@%f", stat, sampleRate);
189 if (doSend(stat)) {
190 retval = true;
191 }
192 }
193 }
194 } else {
195 for (String stat : stats) {
196 if (doSend(stat)) {
197 retval = true;
198 }
199 }
200 }
201
202 return retval;
203 }
204
205 private synchronized boolean doSend(String stat) {
206 try {

Callers 4

timingMethod · 0.95
incrementMethod · 0.95
gaugeMethod · 0.95
flushMethod · 0.45

Calls 2

doSendMethod · 0.95
formatMethod · 0.80

Tested by

no test coverage detected