Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: CI

on:
push:
branches: [master]
pull_request:
branches: ['**']

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy

- name: Check formatting
run: cargo fmt --all -- --check

- name: Build
run: cargo build --lib --bins --verbose

- name: Test
run: cargo test --verbose

- name: Clippy
run: cargo clippy --lib --bins --tests --verbose

# Guards the rust-version in Cargo.toml so the declared MSRV can't silently
# drift above the floor. The toolchain action pins 1.85 as this job's
# default, so a bare cargo invocation builds against it.
msrv:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: dtolnay/rust-toolchain@master
with:
toolchain: "1.85"

- name: Build with MSRV
run: cargo build --lib --bins --verbose

- name: Test with MSRV
run: cargo test --verbose
43 changes: 0 additions & 43 deletions .travis.yml

This file was deleted.

14 changes: 6 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,19 @@
name = "hornet"
version = "0.1.0"
authors = ["Saurav Sachidanand <sauravsachidanand@gmail.com>"]
edition = "2021"
rust-version = "1.84"
license = "MIT OR Apache-2.0"
description = "A Rust implementation of the PCP instrumentation API"
repository = "https://github.com/performancecopilot/hornet"
readme="README.md"
keywords = ["performance", "instrumentation", "metric", "pcp", "mmv"]

[dependencies]
bitflags = "0.9.1"
hdrsample = "4.0.0"
lazy_static = "0.2.8"
bitflags = "2"
hdrhistogram = "=7.5.4"
memmap2 = "0.9"

[dev-dependencies]
rand = "0.3.15"
hyper = "0.11.2"
futures = "0.1.14"
curl = "0.4.8"
iron = "0.5.1"
rand = "0.8"
tempfile = "3.16"
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# hornet [![crates.io badge](https://img.shields.io/crates/v/hornet.svg)](https://crates.io/crates/hornet) [![docs.rs badge](https://docs.rs/hornet/badge.svg)](https://docs.rs/hornet/0.1.0/hornet/) [![Travis CI Build Status](https://travis-ci.org/performancecopilot/hornet.svg?branch=master)](https://travis-ci.org/performancecopilot/hornet) [![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/ccvbo3chne8046vn/branch/master?svg=true)](https://ci.appveyor.com/project/saurvs/hornet-2qtki/branch/master) [![codecov](https://codecov.io/gh/performancecopilot/hornet/branch/master/graph/badge.svg)](https://codecov.io/gh/performancecopilot/hornet)
# hornet [![crates.io badge](https://img.shields.io/crates/v/hornet.svg)](https://crates.io/crates/hornet) [![docs.rs badge](https://docs.rs/hornet/badge.svg)](https://docs.rs/hornet/0.1.0/hornet/) [![CI](https://github.com/performancecopilot/hornet/actions/workflows/ci.yml/badge.svg)](https://github.com/performancecopilot/hornet/actions/workflows/ci.yml)

`hornet` is a Performance Co-Pilot (PCP) Memory Mapped Values (MMV) instrumentation library written in Rust.

Expand Down
70 changes: 0 additions & 70 deletions appveyor.yml

This file was deleted.

9 changes: 3 additions & 6 deletions examples/acme.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
extern crate hornet;
extern crate rand;

use hornet::client::metric::*;
use hornet::client::Client;
use rand::random;
use rand::Rng;
use std::thread;
use std::time::Duration;

Expand Down Expand Up @@ -60,9 +57,9 @@ fn main() {
/* update metrics */

loop {
let rnd_idx = random::<usize>() % products.len();
let rnd_idx = rand::thread_rng().gen_range(0..products.len());
let product = products[rnd_idx];
let working_time = random::<u64>() % 3;
let working_time = rand::thread_rng().gen_range(0..3);
thread::sleep(Duration::from_secs(working_time));

let count = *counts.val(product).unwrap();
Expand Down
3 changes: 0 additions & 3 deletions examples/growth.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
extern crate hornet;
extern crate rand;

use hornet::client::metric::*;
use hornet::client::Client;
use std::thread;
Expand Down
16 changes: 5 additions & 11 deletions examples/histogram.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
extern crate hornet;
extern crate rand;

use hornet::client::metric::*;
use hornet::client::Client;
use rand::distributions::{IndependentSample, Range};
use rand::thread_rng;
use rand::Rng;

/*
For detailed usage and behaviour of the underlying HDR histogram object,
check out jonhoo's hdrsample crate at https://github.com/jonhoo/hdrsample
check out the hdrhistogram crate at https://github.com/HdrHistogram/HdrHistogram_rust
*/

fn main() {
Expand Down Expand Up @@ -42,15 +38,13 @@ fn main() {

/* record 100 random values */

let range = Range::new(low, high);
let mut thread_rng = thread_rng();
let mut rng = rand::thread_rng();

for _ in 0..100 {
hist.record(range.ind_sample(&mut thread_rng)).unwrap();
hist.record(rng.gen_range(low..high)).unwrap();
}

/* record a single random value 100 times */

hist.record_n(range.ind_sample(&mut thread_rng), 100)
.unwrap();
hist.record_n(rng.gen_range(low..high), 100).unwrap();
}
47 changes: 0 additions & 47 deletions examples/http_download.rs

This file was deleted.

87 changes: 0 additions & 87 deletions examples/http_server.rs

This file was deleted.

Loading
Loading