Skip to main content

libsampled - py3

Allows developers to emit samples for ingestion into SampleD

Sample Collection

Sample collection is non-blocking. Samples are sent for ingestion in a background thread.

Samples are batched for ingest once either SAMPLED_BUFFER_FLUSH_SIZE samples have been collected or SAMPLED_BUFFER_FLUSH_INTERVAL_MS milliseconds have passed since the last batch was sent.

On shutdown of your python program samples may be left un-sent, samples are always best-effort delivery.

A sample is a dictionary with str keys and Union[str, int, float, List[str]] values.

Usage Example

from libsampled import sampled, canonical

def main() {
    // do your logic

    sampled.add_sample(dataset="my_awesome_dataset", sample={
        "hostname": canonical.hostname(),
        "logic": __name__,
        "foo": 123,
        "bar": 0.98,
        "baz": ["a", "b", "c"]
    })
}

if __name__ == "__main__":
    main()

Configuration

The following environment variables are available:

Environment Variable Description Default
SAMPLED_BUFFER_FLUSH_SIZE How many samples to keep before sending for ingest 100
SAMPLED_BUFFER_FLUSH_INTERVAL_MS Interval in milliseconds between batches being sent 1000
SAMPLED_DAEMON_HOST host/ipv4/ipv6 address to send samples to localhost
SAMPLED_DAEMON_PORT TCP port number to send samples to 7675

Metadata

Release files for libsampled 0.1.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for libsampled 0.1.5
File Size Uploaded Provenance Actions
libsampled-0.1.5.tar.gz 3.8 kB Without provenance Details for libsampled-0.1.5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for libsampled 0.1.5
File Interpreter ABI Platform Actions
libsampled-0.1.5-py3-none-any.whl Python 3 none any Details for libsampled-0.1.5-py3-none-any.whl

Total release size: 8.3 kB

Release files / libsampled-0.1.5.tar.gz

Download URL libsampled-0.1.5.tar.gz
Size 3.8 kB
Tags Source
SHA-256 checksum
How to use checksums
e2868ff69587a0ad8ffb22fea3afe00abf1e75f8975c69c258fa2a6afddf0637
BLAKE2b-256 checksum
How to use checksums
1f765ae366448eb721345516a4f956ccd8eee12a3eb462ab87358e60bee7b682
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2

Release files / libsampled-0.1.5-py3-none-any.whl

Download URL libsampled-0.1.5-py3-none-any.whl
Size 4.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2798bb59fc9729b13c44ad4aa33143b832e70d2009a9be761306e94a2a296029
BLAKE2b-256 checksum
How to use checksums
1fc0fe3a79d53c6b169934c36ab5bc93e41c2fde8d28a44480f6675a40202605
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2

Security for libsampled 0.1.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.5 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page