Skip to content
This repository has been archived by the owner on Apr 4, 2021. It is now read-only.
/ ratmex Public archive

A rate-measuring executor and a high-performance rate meter

License

Notifications You must be signed in to change notification settings

stIncMale/ratmex

Repository files navigation

RatMeX logo

RatMeX

Java requirement Docs link API docs

About

An open source Java library that supplies a rate meter and a Rate-Measuring eXecutor. This library is designed to be:

property description
high-performance ConcurrentRingBufferRateMeter is able to register 23_000_000 concurrent ticks per second with less than 180ns latency per registration including time spend calling System.nanoTime().
garbage collector friendly RateMeter API is GC-fliendly. ConcurrentRingBufferRateMeter does not produce garbage when is used with SpinLockStrategy. SubmitterWorkerRateMeasuringExecutorService reasonably minimizes creating of garbage.
free of external dependencies No third-party compile- or run-time dependencies are required for your project to use RatMeX.

Rationale

JDK provides us with ScheduledExecutorService.scheduleAtFixedRate, which says the following regarding the task being scheduled: If any execution of this task takes longer than its period, then subsequent executions may start late, but will not concurrently execute. This tells us that ScheduledExecutorService:

  • is allowed to execute tasks with a lower rate than the target, and there is no easy way to check what the actual rate is or to enforce the target rate
  • executes a scheduled task serially, which means we cannot easily benefit from multithreading, and the rate is heavily limited by the time the task takes to complete

RatMeX overcomes both of the above shortcomings.

Versioning

This project uses semantic versioning. The current version is 0.1.0-SNAPSHOT.


Copyright 2015-2018 Valiantsin Kavalenka

Licensed under the Apache License, Version 2.0 (the "License") (except where another license is explicitly specified); you may not use this project except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Releases

No releases published

Packages

No packages published

Languages