chalk-remote-call-python 1.10.11__tar.gz → 1.10.12__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {chalk_remote_call_python-1.10.11/chalk_remote_call_python.egg-info → chalk_remote_call_python-1.10.12}/PKG-INFO +1 -1
- {chalk_remote_call_python-1.10.11 → chalk_remote_call_python-1.10.12}/chalk-remote-call-rs/chalk-remote-call-server/src/metrics.rs +92 -5
- chalk_remote_call_python-1.10.12/chalk_remote_call/_version.py +1 -0
- {chalk_remote_call_python-1.10.11 → chalk_remote_call_python-1.10.12/chalk_remote_call_python.egg-info}/PKG-INFO +1 -1
- chalk_remote_call_python-1.10.11/chalk_remote_call/_version.py +0 -1
- {chalk_remote_call_python-1.10.11 → chalk_remote_call_python-1.10.12}/MANIFEST.in +0 -0
- {chalk_remote_call_python-1.10.11 → chalk_remote_call_python-1.10.12}/README.md +0 -0
- {chalk_remote_call_python-1.10.11 → chalk_remote_call_python-1.10.12}/chalk-remote-call-rs/Cargo.lock +0 -0
- {chalk_remote_call_python-1.10.11 → chalk_remote_call_python-1.10.12}/chalk-remote-call-rs/Cargo.toml +0 -0
- {chalk_remote_call_python-1.10.11 → chalk_remote_call_python-1.10.12}/chalk-remote-call-rs/chalk-remote-call-proto/Cargo.toml +0 -0
- {chalk_remote_call_python-1.10.11 → chalk_remote_call_python-1.10.12}/chalk-remote-call-rs/chalk-remote-call-proto/src/gen/chalk.auth.v1.rs +0 -0
- {chalk_remote_call_python-1.10.11 → chalk_remote_call_python-1.10.12}/chalk-remote-call-rs/chalk-remote-call-proto/src/gen/chalk.common.v1.rs +0 -0
- {chalk_remote_call_python-1.10.11 → chalk_remote_call_python-1.10.12}/chalk-remote-call-rs/chalk-remote-call-proto/src/gen/chalk.runtime.v1.rs +0 -0
- {chalk_remote_call_python-1.10.11 → chalk_remote_call_python-1.10.12}/chalk-remote-call-rs/chalk-remote-call-proto/src/gen/chalk.runtime.v1.tonic.rs +0 -0
- {chalk_remote_call_python-1.10.11 → chalk_remote_call_python-1.10.12}/chalk-remote-call-rs/chalk-remote-call-proto/src/gen/chalk.utils.v1.rs +0 -0
- {chalk_remote_call_python-1.10.11 → chalk_remote_call_python-1.10.12}/chalk-remote-call-rs/chalk-remote-call-proto/src/gen/descriptor.bin +0 -0
- {chalk_remote_call_python-1.10.11 → chalk_remote_call_python-1.10.12}/chalk-remote-call-rs/chalk-remote-call-proto/src/lib.rs +0 -0
- {chalk_remote_call_python-1.10.11 → chalk_remote_call_python-1.10.12}/chalk-remote-call-rs/chalk-remote-call-server/Cargo.toml +0 -0
- {chalk_remote_call_python-1.10.11 → chalk_remote_call_python-1.10.12}/chalk-remote-call-rs/chalk-remote-call-server/build.rs +0 -0
- {chalk_remote_call_python-1.10.11 → chalk_remote_call_python-1.10.12}/chalk-remote-call-rs/chalk-remote-call-server/src/async_service.rs +0 -0
- {chalk_remote_call_python-1.10.11 → chalk_remote_call_python-1.10.12}/chalk-remote-call-rs/chalk-remote-call-server/src/coalesce.rs +0 -0
- {chalk_remote_call_python-1.10.11 → chalk_remote_call_python-1.10.12}/chalk-remote-call-rs/chalk-remote-call-server/src/fnq_client.rs +0 -0
- {chalk_remote_call_python-1.10.11 → chalk_remote_call_python-1.10.12}/chalk-remote-call-rs/chalk-remote-call-server/src/lib.rs +0 -0
- {chalk_remote_call_python-1.10.11 → chalk_remote_call_python-1.10.12}/chalk-remote-call-rs/chalk-remote-call-server/src/python_bridge.rs +0 -0
- {chalk_remote_call_python-1.10.11 → chalk_remote_call_python-1.10.12}/chalk-remote-call-rs/chalk-remote-call-server/src/self_consumer.rs +0 -0
- {chalk_remote_call_python-1.10.11 → chalk_remote_call_python-1.10.12}/chalk-remote-call-rs/chalk-remote-call-server/src/server.rs +0 -0
- {chalk_remote_call_python-1.10.11 → chalk_remote_call_python-1.10.12}/chalk-remote-call-rs/chalk-remote-call-server/src/service.rs +0 -0
- {chalk_remote_call_python-1.10.11 → chalk_remote_call_python-1.10.12}/chalk-remote-call-rs/rust-toolchain.toml +0 -0
- {chalk_remote_call_python-1.10.11 → chalk_remote_call_python-1.10.12}/chalk_remote_call/__init__.py +0 -0
- {chalk_remote_call_python-1.10.11 → chalk_remote_call_python-1.10.12}/chalk_remote_call/__main__.py +0 -0
- {chalk_remote_call_python-1.10.11 → chalk_remote_call_python-1.10.12}/chalk_remote_call/_gen/__init__.py +0 -0
- {chalk_remote_call_python-1.10.11 → chalk_remote_call_python-1.10.12}/chalk_remote_call/_gen/chalk/__init__.py +0 -0
- {chalk_remote_call_python-1.10.11 → chalk_remote_call_python-1.10.12}/chalk_remote_call/_gen/chalk/auth/__init__.py +0 -0
- {chalk_remote_call_python-1.10.11 → chalk_remote_call_python-1.10.12}/chalk_remote_call/_gen/chalk/auth/v1/__init__.py +0 -0
- {chalk_remote_call_python-1.10.11 → chalk_remote_call_python-1.10.12}/chalk_remote_call/_gen/chalk/auth/v1/permissions_pb2.py +0 -0
- {chalk_remote_call_python-1.10.11 → chalk_remote_call_python-1.10.12}/chalk_remote_call/_gen/chalk/auth/v1/permissions_pb2_grpc.py +0 -0
- {chalk_remote_call_python-1.10.11 → chalk_remote_call_python-1.10.12}/chalk_remote_call/_gen/chalk/common/__init__.py +0 -0
- {chalk_remote_call_python-1.10.11 → chalk_remote_call_python-1.10.12}/chalk_remote_call/_gen/chalk/common/v1/__init__.py +0 -0
- {chalk_remote_call_python-1.10.11 → chalk_remote_call_python-1.10.12}/chalk_remote_call/_gen/chalk/common/v1/chalk_error_pb2.py +0 -0
- {chalk_remote_call_python-1.10.11 → chalk_remote_call_python-1.10.12}/chalk_remote_call/_gen/chalk/common/v1/chalk_error_pb2_grpc.py +0 -0
- {chalk_remote_call_python-1.10.11 → chalk_remote_call_python-1.10.12}/chalk_remote_call/_gen/chalk/runtime/__init__.py +0 -0
- {chalk_remote_call_python-1.10.11 → chalk_remote_call_python-1.10.12}/chalk_remote_call/_gen/chalk/runtime/v1/__init__.py +0 -0
- {chalk_remote_call_python-1.10.11 → chalk_remote_call_python-1.10.12}/chalk_remote_call/_gen/chalk/runtime/v1/fnq_consumer_pb2.py +0 -0
- {chalk_remote_call_python-1.10.11 → chalk_remote_call_python-1.10.12}/chalk_remote_call/_gen/chalk/runtime/v1/fnq_consumer_pb2_grpc.py +0 -0
- {chalk_remote_call_python-1.10.11 → chalk_remote_call_python-1.10.12}/chalk_remote_call/_gen/chalk/runtime/v1/remote_python_call_pb2.py +0 -0
- {chalk_remote_call_python-1.10.11 → chalk_remote_call_python-1.10.12}/chalk_remote_call/_gen/chalk/runtime/v1/remote_python_call_pb2_grpc.py +0 -0
- {chalk_remote_call_python-1.10.11 → chalk_remote_call_python-1.10.12}/chalk_remote_call/_gen/chalk/utils/__init__.py +0 -0
- {chalk_remote_call_python-1.10.11 → chalk_remote_call_python-1.10.12}/chalk_remote_call/_gen/chalk/utils/v1/__init__.py +0 -0
- {chalk_remote_call_python-1.10.11 → chalk_remote_call_python-1.10.12}/chalk_remote_call/_gen/chalk/utils/v1/encoding_pb2.py +0 -0
- {chalk_remote_call_python-1.10.11 → chalk_remote_call_python-1.10.12}/chalk_remote_call/_gen/chalk/utils/v1/encoding_pb2_grpc.py +0 -0
- {chalk_remote_call_python-1.10.11 → chalk_remote_call_python-1.10.12}/chalk_remote_call/_gen/chalk/utils/v1/field_change_pb2.py +0 -0
- {chalk_remote_call_python-1.10.11 → chalk_remote_call_python-1.10.12}/chalk_remote_call/_gen/chalk/utils/v1/field_change_pb2_grpc.py +0 -0
- {chalk_remote_call_python-1.10.11 → chalk_remote_call_python-1.10.12}/chalk_remote_call/_gen/chalk/utils/v1/large_pb2.py +0 -0
- {chalk_remote_call_python-1.10.11 → chalk_remote_call_python-1.10.12}/chalk_remote_call/_gen/chalk/utils/v1/large_pb2_grpc.py +0 -0
- {chalk_remote_call_python-1.10.11 → chalk_remote_call_python-1.10.12}/chalk_remote_call/_gen/chalk/utils/v1/sensitive_pb2.py +0 -0
- {chalk_remote_call_python-1.10.11 → chalk_remote_call_python-1.10.12}/chalk_remote_call/_gen/chalk/utils/v1/sensitive_pb2_grpc.py +0 -0
- {chalk_remote_call_python-1.10.11 → chalk_remote_call_python-1.10.12}/chalk_remote_call/_native.pyi +0 -0
- {chalk_remote_call_python-1.10.11 → chalk_remote_call_python-1.10.12}/chalk_remote_call/arrow_utils.py +0 -0
- {chalk_remote_call_python-1.10.11 → chalk_remote_call_python-1.10.12}/chalk_remote_call/cli.py +0 -0
- {chalk_remote_call_python-1.10.11 → chalk_remote_call_python-1.10.12}/chalk_remote_call/errors.py +0 -0
- {chalk_remote_call_python-1.10.11 → chalk_remote_call_python-1.10.12}/chalk_remote_call/handler_loader.py +0 -0
- {chalk_remote_call_python-1.10.11 → chalk_remote_call_python-1.10.12}/chalk_remote_call/input_transform.py +0 -0
- {chalk_remote_call_python-1.10.11 → chalk_remote_call_python-1.10.12}/chalk_remote_call/logging.py +0 -0
- {chalk_remote_call_python-1.10.11 → chalk_remote_call_python-1.10.12}/chalk_remote_call/server.py +0 -0
- {chalk_remote_call_python-1.10.11 → chalk_remote_call_python-1.10.12}/chalk_remote_call/servicer.py +0 -0
- {chalk_remote_call_python-1.10.11 → chalk_remote_call_python-1.10.12}/chalk_remote_call/tracing.py +0 -0
- {chalk_remote_call_python-1.10.11 → chalk_remote_call_python-1.10.12}/chalk_remote_call_python.egg-info/SOURCES.txt +0 -0
- {chalk_remote_call_python-1.10.11 → chalk_remote_call_python-1.10.12}/chalk_remote_call_python.egg-info/dependency_links.txt +0 -0
- {chalk_remote_call_python-1.10.11 → chalk_remote_call_python-1.10.12}/chalk_remote_call_python.egg-info/entry_points.txt +0 -0
- {chalk_remote_call_python-1.10.11 → chalk_remote_call_python-1.10.12}/chalk_remote_call_python.egg-info/requires.txt +0 -0
- {chalk_remote_call_python-1.10.11 → chalk_remote_call_python-1.10.12}/chalk_remote_call_python.egg-info/top_level.txt +0 -0
- {chalk_remote_call_python-1.10.11 → chalk_remote_call_python-1.10.12}/pyproject.toml +0 -0
- {chalk_remote_call_python-1.10.11 → chalk_remote_call_python-1.10.12}/setup.cfg +0 -0
- {chalk_remote_call_python-1.10.11 → chalk_remote_call_python-1.10.12}/setup.py +0 -0
|
@@ -19,7 +19,7 @@ use chalk_statsd::metrics::MetricsClient;
|
|
|
19
19
|
use tracing::{debug, warn};
|
|
20
20
|
|
|
21
21
|
const DEQUEUED_METRIC: &str = "chalk.function_call.dequeued";
|
|
22
|
-
const
|
|
22
|
+
const CALL_DURATION_METRIC: &str = "chalk.function_call.call_duration";
|
|
23
23
|
|
|
24
24
|
// Batch tuning — chalk_function_queue's defaults (METRICS_BATCH_* ), inlined.
|
|
25
25
|
const BATCH_MAX_MESSAGES: usize = 1000;
|
|
@@ -220,7 +220,7 @@ pub fn record_completed_call(
|
|
|
220
220
|
if let Some(statsd) = &metrics.statsd {
|
|
221
221
|
let tags = call_tags(&function_name, success, mode);
|
|
222
222
|
statsd.publish_count_eager(DEQUEUED_METRIC, 1, &tags);
|
|
223
|
-
statsd.publish_distribution_eager(
|
|
223
|
+
statsd.publish_distribution_eager(CALL_DURATION_METRIC, elapsed_ms, &tags);
|
|
224
224
|
}
|
|
225
225
|
|
|
226
226
|
if let Some(pipeline) = &metrics.pipeline {
|
|
@@ -302,7 +302,7 @@ mod tests {
|
|
|
302
302
|
}
|
|
303
303
|
|
|
304
304
|
#[test]
|
|
305
|
-
fn
|
|
305
|
+
fn emits_count_and_call_duration_over_udp() {
|
|
306
306
|
let sink = UdpSocket::bind("127.0.0.1:0").unwrap();
|
|
307
307
|
sink.set_read_timeout(Some(Duration::from_secs(5))).unwrap();
|
|
308
308
|
let metrics = CallMetrics {
|
|
@@ -325,13 +325,13 @@ mod tests {
|
|
|
325
325
|
|
|
326
326
|
let mut seen = String::new();
|
|
327
327
|
let mut buf = [0u8; 2048];
|
|
328
|
-
while !(seen.contains(DEQUEUED_METRIC) && seen.contains(
|
|
328
|
+
while !(seen.contains(DEQUEUED_METRIC) && seen.contains(CALL_DURATION_METRIC)) {
|
|
329
329
|
let n = sink.recv(&mut buf).expect("statsd packet");
|
|
330
330
|
seen.push_str(&String::from_utf8_lossy(&buf[..n]));
|
|
331
331
|
}
|
|
332
332
|
assert!(seen.contains("chalk.function_call.dequeued:1|c"), "{seen}");
|
|
333
333
|
assert!(
|
|
334
|
-
seen.contains("chalk.function_call.
|
|
334
|
+
seen.contains("chalk.function_call.call_duration:250|d"),
|
|
335
335
|
"{seen}"
|
|
336
336
|
);
|
|
337
337
|
assert!(seen.contains("function_name:fn_a"), "{seen}");
|
|
@@ -340,6 +340,93 @@ mod tests {
|
|
|
340
340
|
assert!(seen.contains("kind:function"), "{seen}");
|
|
341
341
|
}
|
|
342
342
|
|
|
343
|
+
#[tokio::test]
|
|
344
|
+
async fn measures_real_python_handler_duration_over_udp() {
|
|
345
|
+
use crate::python_bridge::{ChunkBuffer, PythonHandler};
|
|
346
|
+
use pyo3::prelude::*;
|
|
347
|
+
|
|
348
|
+
Python::initialize();
|
|
349
|
+
let handler = Python::attach(|py| {
|
|
350
|
+
Arc::new(PythonHandler::new(
|
|
351
|
+
py.eval(
|
|
352
|
+
pyo3::ffi::c_str!("lambda: __import__('time').sleep(0.06)"),
|
|
353
|
+
None,
|
|
354
|
+
None,
|
|
355
|
+
)
|
|
356
|
+
.unwrap()
|
|
357
|
+
.unbind(),
|
|
358
|
+
py.eval(
|
|
359
|
+
pyo3::ffi::c_str!(
|
|
360
|
+
"lambda data, handler, args, context, emit: (handler(), emit(b'result'))"
|
|
361
|
+
),
|
|
362
|
+
None,
|
|
363
|
+
None,
|
|
364
|
+
)
|
|
365
|
+
.unwrap()
|
|
366
|
+
.unbind(),
|
|
367
|
+
None,
|
|
368
|
+
))
|
|
369
|
+
});
|
|
370
|
+
let sink = UdpSocket::bind("127.0.0.1:0").unwrap();
|
|
371
|
+
sink.set_read_timeout(Some(Duration::from_secs(5))).unwrap();
|
|
372
|
+
let metrics = CallMetrics {
|
|
373
|
+
statsd: Some(Arc::new(
|
|
374
|
+
MetricsClient::new_from_datadog_config_unbatched(DatadogConnection::UdpSocket(
|
|
375
|
+
sink.local_addr().unwrap().to_string(),
|
|
376
|
+
))
|
|
377
|
+
.unwrap(),
|
|
378
|
+
)),
|
|
379
|
+
pipeline: None,
|
|
380
|
+
};
|
|
381
|
+
|
|
382
|
+
let started = std::time::Instant::now();
|
|
383
|
+
let result = handler
|
|
384
|
+
.call_into_buffer(
|
|
385
|
+
vec![1],
|
|
386
|
+
"real_handler".to_string(),
|
|
387
|
+
HashMap::new(),
|
|
388
|
+
String::new(),
|
|
389
|
+
ChunkBuffer::new().into_shared(),
|
|
390
|
+
)
|
|
391
|
+
.await;
|
|
392
|
+
let elapsed = started.elapsed();
|
|
393
|
+
assert!(result.is_ok(), "handler failed: {result:?}");
|
|
394
|
+
record_completed_call(&metrics, "real_handler", true, elapsed, Mode::Async);
|
|
395
|
+
|
|
396
|
+
let mut packets = Vec::new();
|
|
397
|
+
let mut buf = [0u8; 2048];
|
|
398
|
+
while packets.len() < 2 {
|
|
399
|
+
let n = sink.recv(&mut buf).expect("StatsD packet");
|
|
400
|
+
packets.push(String::from_utf8_lossy(&buf[..n]).to_string());
|
|
401
|
+
}
|
|
402
|
+
let distribution_value = |name: &str| -> f64 {
|
|
403
|
+
let packet = packets
|
|
404
|
+
.iter()
|
|
405
|
+
.find(|packet| packet.starts_with(name))
|
|
406
|
+
.unwrap_or_else(|| panic!("missing {name}: {packets:?}"));
|
|
407
|
+
let value = packet
|
|
408
|
+
.strip_prefix(name)
|
|
409
|
+
.unwrap()
|
|
410
|
+
.split('|')
|
|
411
|
+
.next()
|
|
412
|
+
.unwrap()
|
|
413
|
+
.parse::<f64>()
|
|
414
|
+
.unwrap();
|
|
415
|
+
assert!(packet.contains("|d"), "expected distribution: {packet}");
|
|
416
|
+
value
|
|
417
|
+
};
|
|
418
|
+
let call_duration = distribution_value("chalk.function_call.call_duration:");
|
|
419
|
+
assert!(
|
|
420
|
+
call_duration >= 50.0,
|
|
421
|
+
"60 ms handler sleep yielded {call_duration} ms call duration"
|
|
422
|
+
);
|
|
423
|
+
assert!(
|
|
424
|
+
(call_duration - elapsed.as_secs_f64() * 1000.0).abs() < 1.0,
|
|
425
|
+
"emitted {call_duration} ms, measured {elapsed:?}"
|
|
426
|
+
);
|
|
427
|
+
println!("60 ms Python handler sleep yielded {call_duration:.2} ms call duration");
|
|
428
|
+
}
|
|
429
|
+
|
|
343
430
|
fn call_metrics(pipeline: &Arc<PublishingMetricsPipeline>) -> Arc<CallMetrics> {
|
|
344
431
|
Arc::new(CallMetrics {
|
|
345
432
|
statsd: None,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "1.10.12"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "1.10.11"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{chalk_remote_call_python-1.10.11 → chalk_remote_call_python-1.10.12}/chalk_remote_call/__init__.py
RENAMED
|
File without changes
|
{chalk_remote_call_python-1.10.11 → chalk_remote_call_python-1.10.12}/chalk_remote_call/__main__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{chalk_remote_call_python-1.10.11 → chalk_remote_call_python-1.10.12}/chalk_remote_call/_native.pyi
RENAMED
|
File without changes
|
|
File without changes
|
{chalk_remote_call_python-1.10.11 → chalk_remote_call_python-1.10.12}/chalk_remote_call/cli.py
RENAMED
|
File without changes
|
{chalk_remote_call_python-1.10.11 → chalk_remote_call_python-1.10.12}/chalk_remote_call/errors.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{chalk_remote_call_python-1.10.11 → chalk_remote_call_python-1.10.12}/chalk_remote_call/logging.py
RENAMED
|
File without changes
|
{chalk_remote_call_python-1.10.11 → chalk_remote_call_python-1.10.12}/chalk_remote_call/server.py
RENAMED
|
File without changes
|
{chalk_remote_call_python-1.10.11 → chalk_remote_call_python-1.10.12}/chalk_remote_call/servicer.py
RENAMED
|
File without changes
|
{chalk_remote_call_python-1.10.11 → chalk_remote_call_python-1.10.12}/chalk_remote_call/tracing.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|