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

janus_collector

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

135 releases

new 0.7.5 Apr 16, 2024
0.7.1 Mar 21, 2024
0.6.25 Apr 16, 2024
0.6.7 Dec 14, 2023
0.1.24 Nov 16, 2022

#363 in Network programming

Download history 3/week @ 2023-12-29 9/week @ 2024-01-05 11/week @ 2024-01-12 6/week @ 2024-01-19 18/week @ 2024-02-02 98/week @ 2024-02-09 233/week @ 2024-02-16 379/week @ 2024-02-23 423/week @ 2024-03-01 397/week @ 2024-03-08 464/week @ 2024-03-15 203/week @ 2024-03-22 337/week @ 2024-03-29 529/week @ 2024-04-05

1,555 downloads per month

MPL-2.0 license

440KB
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

~38–54MB
~1M SLoC