Skip to content

Commit

Permalink
Add action mnemonic to clickhouse
Browse files Browse the repository at this point in the history
I expect this to add less than 1% to write throughput.
  • Loading branch information
vanja-p committed Dec 19, 2024
1 parent 05d2b97 commit b7cf06d
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,7 @@ func (s *ExecutionServer) recordExecution(ctx context.Context, executionID strin
executionProto := execution.TableExecToProto(&executionPrimaryDB, link)
// Set fields that aren't stored in the primary DB
executionProto.TargetLabel = rmd.GetTargetId()
executionProto.ActionMnemonic = rmd.GetActionMnemonic()
executionProto.DiskBytesRead = md.GetUsageStats().GetCgroupIoStats().GetRbytes()
executionProto.DiskBytesWritten = md.GetUsageStats().GetCgroupIoStats().GetWbytes()
executionProto.DiskWriteOperations = md.GetUsageStats().GetCgroupIoStats().GetWios()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,8 @@ func testExecuteAndPublishOperation(t *testing.T, test publishTest) {
// Schedule execution
clientCtx, err := bazel_request.WithRequestMetadata(ctx, &repb.RequestMetadata{
ToolInvocationId: invocationID,
TargetId: "//some:test",
ActionMnemonic: "TestRunner",
})
require.NoError(t, err)
for k, v := range test.platformOverrides {
Expand Down Expand Up @@ -534,6 +536,8 @@ func testExecuteAndPublishOperation(t *testing.T, test publishTest) {
RequestedMemoryBytes: 2000,
RequestedMilliCpu: 1500,
RequestedIsolationType: "oci",
TargetLabel: "//some:test",
ActionMnemonic: "TestRunner",
}
if test.publishMoreMetadata {
expectedExecution.ExecutionPriority = 999
Expand Down
3 changes: 2 additions & 1 deletion proto/remote_execution.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2460,6 +2460,7 @@ message StoredExecution {
string output_path = 31;
string status_message = 32;

// TODO(sluongng): add mnemonic and configuration.
// TODO(sluongng): add configuration.
string target_label = 33;
string action_mnemonic = 57;
}
1 change: 1 addition & 0 deletions server/util/clickhouse/clickhouse.go
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@ func buildExecution(in *repb.StoredExecution, inv *sipb.StoredInvocation) *schem
InvocationStatus: inv.GetInvocationStatus(),
Tags: invocation_format.ConvertDBTagsToOLAP(inv.GetTags()),
TargetLabel: in.GetTargetLabel(),
ActionMnemonic: in.GetActionMnemonic(),
}
}

Expand Down
4 changes: 3 additions & 1 deletion server/util/clickhouse/schema/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,8 @@ type Execution struct {
Stage int64

// RequestMetadata
TargetLabel string
TargetLabel string
ActionMnemonic string

// IOStats
FileDownloadCount int64
Expand Down Expand Up @@ -268,6 +269,7 @@ func (e *Execution) AdditionalFields() []string {
"Tags",
"OutputPath",
"TargetLabel",
"ActionMnemonic",
"DiskBytesRead",
"DiskBytesWritten",
"DiskReadOperations",
Expand Down

0 comments on commit b7cf06d

Please sign in to comment.