Comments (2)
I don't think this is a bug. Notice that Clojure Ratio is lazy - actual computation will not be done until is explicitly casted or converted. Take a look at these measurements - explicit conversion adds some overhead:
(require 'criterium.core)
;; no explicit conversion
(criterium.core/bench (doall (map #(/ 1234 %) (range 2 25))))
; Evaluation count : 26816220 in 60 samples of 446937 calls.
; Execution time mean : 2.232489 µs
; Execution time std-deviation : 29.268225 ns
; Execution time lower quantile : 2.217370 µs ( 2.5%)
; Execution time upper quantile : 2.318537 µs (97.5%)
; Overhead used : 7.253383 ns
;
; Found 4 outliers in 60 samples (6.6667 %)
; low-severe 1 (1.6667 %)
; low-mild 3 (5.0000 %)
; Variance from outliers : 1.6389 % Variance is slightly inflated by outliers
;; explicit conversion to long
(criterium.core/bench (doall (map #(long (/ 1234 %)) (range 2 25))))
; Evaluation count : 18773880 in 60 samples of 312898 calls.
; Execution time mean : 3.206310 µs
; Execution time std-deviation : 39.479470 ns
; Execution time lower quantile : 3.180998 µs ( 2.5%)
; Execution time upper quantile : 3.310231 µs (97.5%)
; Overhead used : 7.253383 ns
;
; Found 5 outliers in 60 samples (8.3333 %)
; low-severe 2 (3.3333 %)
; low-mild 3 (5.0000 %)
; Variance from outliers : 1.6389 % Variance is slightly inflated by outliers
In your case, I'd explicitly convert it to desired format before you print it. The same is done for other destinations (e.g. InfluxDB) - numbers are converted before they are saved at desired precision. In between, they are flowing as lazy unevaluted number type.
from riemann.
I was leaning towards updating riemann.time/unix-time-real
to (quot (System/currentTimeMillis) 1000)
It is also inconsistent with riemann.common.event
which does (long (round (unix-time)))
from riemann.
Related Issues (20)
- Slack notifications do not work with new slack app webhooks
- Which versions of riemann, if any, are susceptible to log4shell (log4j vulnerability)? HOT 1
- Docker image builds switched architecture HOT 2
- Store the events for riemann in an external database HOT 3
- functions using riemann.folds/count drops suddenly on high load HOT 2
- Logback needs update to 1.2.10 HOT 1
- [influxdb.clj] SSLSocketfactory not supported on JDK 9+ HOT 1
- Netty executor queue size is infinite resulting in GC pressure / OOM HOT 4
- Has 0.3.8 been retagged? HOT 1
- "Interrupted consumption" from riemann.kafka and it never recovers HOT 3
- `-XX:-StackTraceInThrowable` causes a index out of bounds exception HOT 1
- amazonica throws RuntimeException on jdk 17/18
- `influxdb2` keeps accumulating background threads HOT 3
- Riemann becomes unresponsive when CPU Count count is increased HOT 9
- "Throttle" is not working as expected HOT 5
- Questions: prometheus-batch exceptions HOT 6
- Auto-reload the Kafka Consumer HOT 3
- Riemann writes not all messages to InfluxDB HOT 2
- Implement InfluxDB 2.0 plugin HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from riemann.