#collector #janus #distributed #protocols #aggregation #metrics #up

janus_collector

Collector for Janus, the server powering ISRG's Divvi Up

154 releases

new 0.7.12 May 20, 2024
0.7.6 Apr 25, 2024
0.7.1 Mar 21, 2024
0.6.7 Dec 14, 2023
0.1.24 Nov 16, 2022

#1 in #collector

Download history 21/week @ 2024-02-04 118/week @ 2024-02-11 248/week @ 2024-02-18 525/week @ 2024-02-25 295/week @ 2024-03-03 467/week @ 2024-03-10 526/week @ 2024-03-17 15/week @ 2024-03-24 387/week @ 2024-03-31 566/week @ 2024-04-07 312/week @ 2024-04-14 277/week @ 2024-04-21 393/week @ 2024-04-28 375/week @ 2024-05-05 668/week @ 2024-05-12

1,724 downloads per month

MPL-2.0 license

445KB
10K SLoC

janus_collector

Build Status latest version docs badge

janus_collector is a self-contained implementation of the Distributed Aggregation Protocol's collector role. It is intended for use with Janus and Divvi Up, ISRG's privacy-respecting metrics service. janus_collector is published to crates.io by a GitHub Action that runs when a janus release is created.


lib.rs:

A DAP-PPM collector

This library implements the collector role of the DAP-PPM protocol. It works in concert with two DAP-PPM aggregator servers to compute a statistical aggregate over data from many clients, while preserving the privacy of each client's data.

Examples

use janus_collector::{AuthenticationToken, Collector};
use janus_core::{hpke::generate_hpke_config_and_private_key};
use janus_messages::{
    Duration, HpkeAeadId, HpkeConfig, HpkeConfigId, HpkeKdfId, HpkeKemId, Interval, TaskId,
    Time, Query,
};
use prio::vdaf::prio3::Prio3;
use rand::random;
use url::Url;

// Supply DAP task parameters.
let task_id = random();
let hpke_keypair = janus_core::hpke::generate_hpke_config_and_private_key(
    HpkeConfigId::from(0),
    HpkeKemId::X25519HkdfSha256,
    HpkeKdfId::HkdfSha256,
    HpkeAeadId::Aes128Gcm,
).unwrap();

// Supply a VDAF implementation, corresponding to this task.
let vdaf = Prio3::new_count(2).unwrap();
let collector = Collector::new(
    task_id,
    "https://example.com/dap/".parse().unwrap(),
    AuthenticationToken::new_bearer_token_from_string("Y29sbGVjdG9yIHRva2Vu").unwrap(),
    hpke_keypair,
    vdaf,
)
.unwrap();

// Specify the time interval over which the aggregation should be calculated.
let interval = Interval::new(
    Time::from_seconds_since_epoch(1_656_000_000),
    Duration::from_seconds(3600),
)
.unwrap();
// Make the requests and retrieve the aggregated statistic.
let aggregation_result = collector.collect(Query::new_time_interval(interval), &()).await.unwrap();

Dependencies

~37–52MB
~1M SLoC