agentsclimarketplace

Api response latency measurement

Skill HolobiomicsLab/asb-skill-collections/collections/metabolomics/v1/skills/api-response-latency-measurement

Curated, evidence-grounded skill and software-tool collections for scientific AI agents, generated by the AgenticScienceBuilder

Install
npx -y skills add HolobiomicsLab/asb-skill-collections --skill api-response-latency-measurement

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 14 stars14 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

Use when when annotating .msp files with metadata from multiple external web services and you need to monitor which services are slow or unreliable.

The file declares its own license as CC-BY-4.0. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.

SKILL.md

7.0 KB, ~1.2k tokens by cl100k_base, as published. Nobody here has run it

api-response-latency-measurement

Summary

Measure and aggregate HTTP response latencies from external web services (CIR, CTS, PubChem, IDSM, BridgeDb) during asynchronous annotation runs in MSMetaEnhancer. This skill enables detection of service degradation and bottlenecks in metadata fetching workflows.

When to use

When annotating .msp files with metadata from multiple external web services and you need to monitor which services are slow or unreliable. Apply this skill if you are running asynchronous annotation jobs and want to track per-service performance degradation over time or across multiple annotation runs.

When NOT to use

  • You are using only local, in-process converters (e.g., RDKit) with no external web service calls.
  • Your annotation workflow is synchronous and does not require concurrent service monitoring.
  • You only care about whether a service succeeded or failed, not timing performance.

Inputs

  • HTTP request/response pairs from external web services during annotation
  • Asynchronous task logs containing request start and end timestamps
  • Service endpoint URLs (CIR, CTS, PubChem, IDSM, BridgeDb)
  • .msp file annotation job configuration with service list

Outputs

  • JSON report file with per-service latency metrics (mean, std, percentiles, min/max)
  • Monitor object with aggregated latency state for each registered service
  • Time-series latency logs for trend analysis across annotation runs

How to apply

Design a Monitor class that registers all available web services (CIR, CTS, PubChem, IDSM, BridgeDb) and initializes per-service state trackers. Implement asynchronous health-check methods that probe each web converter's endpoint and record HTTP status codes and response times. Add error-logging callbacks to the WebConverter base class to capture request timing data and route it to Monitor for aggregation. At configurable intervals, compute per-service metrics including mean latency, latency percentiles, and latency trends. Serialize aggregated latency statistics to a JSON report file with timestamp and per-service summary, allowing downstream analysis of service performance patterns.

Related tools

Examples

from MSMetaEnhancer.libs.monitor import Monitor; monitor = Monitor(services=['CIR', 'CTS', 'PubChem', 'IDSM', 'BridgeDb']); await monitor.run_health_checks(); report = monitor.aggregate_metrics(); monitor.serialize_report('service_latency_report.json')

Evaluation signals

  • JSON report file is valid JSON schema with 'timestamp', 'services', and 'overall_health' keys present
  • All five registered services (CIR, CTS, PubChem, IDSM, BridgeDb) appear in the latency report
  • Per-service latency metrics (mean, min, max, count) are non-negative numbers and mean ≥ min and mean ≤ max
  • Latency values are within reasonable bounds for network requests (> 0ms, typically < 30,000ms for web APIs)
  • Report timestamp is valid and recent relative to annotation job completion time

Limitations

  • Latency measurement reflects network round-trip time only; does not account for local processing overhead in annotation logic.
  • Measurement accuracy depends on system clock precision and may be affected by high CPU contention on the host machine.
  • Asynchronous scheduling overhead (task queue, event loop latency) is not separated from actual HTTP service latency.
  • If a service is completely unavailable (connection refused), latency may be recorded as timeout duration rather than true response time.
  • Latency aggregation at configurable intervals may miss transient spikes or brief service degradation between report windows.

Evidence

  • [other] MSMetaEnhancer fetches metadata from five external web services: CIR, CTS, PubChem, IDSM, and BridgeDb: "MSMetaEnhancer fetches metadata from five external web services: CIR, CTS, PubChem, IDSM, and BridgeDb, using an asynchronous implementation for the annotation process."
  • [other] Implement asynchronous service health-check methods that probe each web converter's endpoint and record HTTP status codes and response times: "Implement asynchronous service health-check methods that probe each web converter's endpoint and record HTTP status codes and response times."
  • [other] Create a status-aggregation method that computes per-service metrics (availability percentage, total errors, mean latency) at configurable intervals: "Create a status-aggregation method that computes per-service metrics (availability percentage, total errors, mean latency) at configurable intervals."
  • [other] Serialize the aggregated status to a JSON report file with timestamp, per-service summary, and overall health state: "Serialize the aggregated status to a JSON report file with timestamp, per-service summary, and overall health state."
  • [readme] The app uses asynchronous implementation of annotation process allowing for optimal fetching speed: "The app uses asynchronous implementation of annotation process allowing for optimal fetching speed."

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.