Skip to content

Commit 14decb6

Browse files
committed
Download Stats
1 parent 7acda96 commit 14decb6

File tree

5 files changed

+98
-0
lines changed

5 files changed

+98
-0
lines changed

openapi/openapiv2.json

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11498,6 +11498,31 @@
1149811498
}
1149911499
}
1150011500
},
11501+
"v1ExternalPayloadDownloadStats": {
11502+
"type": "object",
11503+
"properties": {
11504+
"payloadCount": {
11505+
"type": "string",
11506+
"format": "int64",
11507+
"description": "Number of external payloads downloaded."
11508+
},
11509+
"totalSizeBytes": {
11510+
"type": "string",
11511+
"format": "int64",
11512+
"description": "Total size in bytes of downloaded payloads."
11513+
},
11514+
"downloadTime": {
11515+
"type": "string",
11516+
"format": "date-time",
11517+
"description": "Wall time spent downloading."
11518+
},
11519+
"replayInvolved": {
11520+
"type": "boolean",
11521+
"description": "True if any portion of this workflow task processed history in replay mode\n(i.e., SDK had to rebuild state) and downloaded payloads during that period."
11522+
}
11523+
},
11524+
"description": "Stats about external payloads downloaded by SDK during workflow task processing."
11525+
},
1150111526
"v1ExternalWorkflowExecutionCancelRequestedEventAttributes": {
1150211527
"type": "object",
1150311528
"properties": {
@@ -17667,6 +17692,10 @@
1766717692
"deploymentVersion": {
1766817693
"$ref": "#/definitions/v1WorkerDeploymentVersion",
1766917694
"description": "The Worker Deployment Version that completed this task. Must be set if `versioning_behavior`\nis set. This value updates workflow execution's `versioning_info.deployment_version`.\nExperimental. Worker Deployments are experimental and might significantly change in the future."
17695+
},
17696+
"externalPayloadStats": {
17697+
"$ref": "#/definitions/v1ExternalPayloadDownloadStats",
17698+
"description": "Stats about external payloads downloaded by SDK."
1767017699
}
1767117700
}
1767217701
},
@@ -17788,6 +17817,10 @@
1778817817
"workerVersion": {
1778917818
"$ref": "#/definitions/v1WorkerVersionStamp",
1779017819
"title": "Version info of the worker who processed this workflow task. If present, the `build_id` field\nwithin is also used as `binary_checksum`, which may be omitted in that case (it may also be\npopulated to preserve compatibility).\nDeprecated. This field should be cleaned up when versioning-2 API is removed. [cleanup-experimental-wv]"
17820+
},
17821+
"externalPayloadStats": {
17822+
"$ref": "#/definitions/v1ExternalPayloadDownloadStats",
17823+
"description": "Stats about external payloads downloaded by SDK."
1779117824
}
1779217825
}
1779317826
},

openapi/openapiv3.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8349,6 +8349,25 @@ components:
83498349
$ref: '#/components/schemas/StartWorkflowExecutionResponse'
83508350
updateWorkflow:
83518351
$ref: '#/components/schemas/UpdateWorkflowExecutionResponse'
8352+
ExternalPayloadDownloadStats:
8353+
type: object
8354+
properties:
8355+
payloadCount:
8356+
type: string
8357+
description: Number of external payloads downloaded.
8358+
totalSizeBytes:
8359+
type: string
8360+
description: Total size in bytes of downloaded payloads.
8361+
downloadTime:
8362+
type: string
8363+
description: Wall time spent downloading.
8364+
format: date-time
8365+
replayInvolved:
8366+
type: boolean
8367+
description: |-
8368+
True if any portion of this workflow task processed history in replay mode
8369+
(i.e., SDK had to rebuild state) and downloaded payloads during that period.
8370+
description: Stats about external payloads downloaded by SDK during workflow task processing.
83528371
ExternalWorkflowExecutionCancelRequestedEventAttributes:
83538372
type: object
83548373
properties:
@@ -15222,6 +15241,10 @@ components:
1522215241
The Worker Deployment Version that completed this task. Must be set if `versioning_behavior`
1522315242
is set. This value updates workflow execution's `versioning_info.deployment_version`.
1522415243
Experimental. Worker Deployments are experimental and might significantly change in the future.
15244+
externalPayloadStats:
15245+
allOf:
15246+
- $ref: '#/components/schemas/ExternalPayloadDownloadStats'
15247+
description: Stats about external payloads downloaded by SDK.
1522515248
WorkflowTaskCompletedMetadata:
1522615249
type: object
1522715250
properties:
@@ -15360,6 +15383,10 @@ components:
1536015383
within is also used as `binary_checksum`, which may be omitted in that case (it may also be
1536115384
populated to preserve compatibility).
1536215385
Deprecated. This field should be cleaned up when versioning-2 API is removed. [cleanup-experimental-wv]
15386+
externalPayloadStats:
15387+
allOf:
15388+
- $ref: '#/components/schemas/ExternalPayloadDownloadStats'
15389+
description: Stats about external payloads downloaded by SDK.
1536315390
WorkflowTaskScheduledEventAttributes:
1536415391
type: object
1536515392
properties:

temporal/api/history/v1/message.proto

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import "temporal/api/failure/v1/message.proto";
2222
import "temporal/api/taskqueue/v1/message.proto";
2323
import "temporal/api/update/v1/message.proto";
2424
import "temporal/api/workflow/v1/message.proto";
25+
import "temporal/api/sdk/v1/external_payload_download_stats.proto";
2526
import "temporal/api/sdk/v1/task_complete_metadata.proto";
2627
import "temporal/api/sdk/v1/user_metadata.proto";
2728

@@ -330,6 +331,8 @@ message WorkflowTaskCompletedEventAttributes {
330331
// is set. This value updates workflow execution's `versioning_info.deployment_version`.
331332
// Experimental. Worker Deployments are experimental and might significantly change in the future.
332333
temporal.api.deployment.v1.WorkerDeploymentVersion deployment_version = 11;
334+
// Stats about external payloads downloaded by SDK.
335+
temporal.api.sdk.v1.ExternalPayloadDownloadStats external_payload_stats = 12;
333336
}
334337

335338
message WorkflowTaskTimedOutEventAttributes {
@@ -366,6 +369,8 @@ message WorkflowTaskFailedEventAttributes {
366369
// populated to preserve compatibility).
367370
// Deprecated. This field should be cleaned up when versioning-2 API is removed. [cleanup-experimental-wv]
368371
temporal.api.common.v1.WorkerVersionStamp worker_version = 10 [deprecated = true];
372+
// Stats about external payloads downloaded by SDK.
373+
temporal.api.sdk.v1.ExternalPayloadDownloadStats external_payload_stats = 11;
369374
}
370375

371376
message ActivityTaskScheduledEventAttributes {
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
syntax = "proto3";
2+
3+
package temporal.api.sdk.v1;
4+
5+
option go_package = "go.temporal.io/api/sdk/v1;sdk";
6+
option java_package = "io.temporal.api.sdk.v1";
7+
option java_multiple_files = true;
8+
option java_outer_classname = "ExternalPayloadDownloadStatsProto";
9+
option ruby_package = "Temporalio::Api::Sdk::V1";
10+
option csharp_namespace = "Temporalio.Api.Sdk.V1";
11+
12+
import "google/protobuf/timestamp.proto";
13+
14+
// Stats about external payloads downloaded by SDK during workflow task processing.
15+
message ExternalPayloadDownloadStats {
16+
// Number of external payloads downloaded.
17+
int64 payload_count = 1;
18+
19+
// Total size in bytes of downloaded payloads.
20+
int64 total_size_bytes = 2;
21+
22+
// Wall time spent downloading.
23+
google.protobuf.Timestamp download_time = 3;
24+
25+
// True if any portion of this workflow task processed history in replay mode
26+
// (i.e., SDK had to rebuild state) and downloaded payloads during that period.
27+
bool replay_involved = 4;
28+
}

temporal/api/workflowservice/v1/request_response.proto

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ import "temporal/api/taskqueue/v1/message.proto";
3838
import "temporal/api/update/v1/message.proto";
3939
import "temporal/api/version/v1/message.proto";
4040
import "temporal/api/batch/v1/message.proto";
41+
import "temporal/api/sdk/v1/external_payload_download_stats.proto";
4142
import "temporal/api/sdk/v1/task_complete_metadata.proto";
4243
import "temporal/api/sdk/v1/user_metadata.proto";
4344
import "temporal/api/nexus/v1/message.proto";
@@ -372,6 +373,8 @@ message RespondWorkflowTaskCompletedRequest {
372373
temporal.api.enums.v1.VersioningBehavior versioning_behavior = 16;
373374
// Worker deployment options that user has set in the worker.
374375
temporal.api.deployment.v1.WorkerDeploymentOptions deployment_options = 17;
376+
// Stats about external payloads downloaded by SDK.
377+
temporal.api.sdk.v1.ExternalPayloadDownloadStats external_payload_stats = 18;
375378

376379
// SDK capability details.
377380
message Capabilities {
@@ -423,6 +426,8 @@ message RespondWorkflowTaskFailedRequest {
423426
temporal.api.deployment.v1.Deployment deployment = 9 [deprecated = true];
424427
// Worker deployment options that user has set in the worker.
425428
temporal.api.deployment.v1.WorkerDeploymentOptions deployment_options = 10;
429+
// Stats about external payloads downloaded by SDK.
430+
temporal.api.sdk.v1.ExternalPayloadDownloadStats external_payload_stats = 11;
426431
}
427432

428433
message RespondWorkflowTaskFailedResponse {

0 commit comments

Comments
 (0)