indicatrix-worker 0.7.2

Coordinator and render worker for an indicatrix-backed design catalogue. `serve` (default build) is the coordinator: it serves indicatrix-net's read-only design-library protocol to viewers over mutual TLS and accepts joining render workers on a separate worker port. The optional `worker` feature adds render capacity -- `join` (dial a coordinator and render its requests), `serve --render` (render with the coordinator's own CPU/GPU) and `render` (a one-shot scene-to-PNG CLI).
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//! Tests for [`effective_cadence_ms`]'s wall-clock interval averaging.

use crate::stream_emit::emitter::effective_cadence_ms;
use std::time::Duration;

#[test]
fn effective_cadence_ms_is_zero_for_fewer_than_two_emissions() {
    assert_eq!(effective_cadence_ms(Duration::from_secs(1), 0), 0);
    assert_eq!(effective_cadence_ms(Duration::from_secs(1), 1), 0);
}

#[test]
fn effective_cadence_ms_averages_the_interval() {
    // 3 emissions over 2 seconds -> 2 intervals -> 1000ms average.
    assert_eq!(effective_cadence_ms(Duration::from_secs(2), 3), 1000);
}