Skip to content

Commit

Permalink
Some comments and TODOs
Browse files Browse the repository at this point in the history
  • Loading branch information
graebm committed Oct 15, 2024
1 parent e088cff commit 06e4ca4
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
15 changes: 13 additions & 2 deletions runners/s3-benchrunner-rust/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,19 @@

PARSER = argparse.ArgumentParser(description="Graph a benchmark run")

# File contains JSON representation of OTLP TracesData
# see: https://github.com/open-telemetry/opentelemetry-proto/blob/main/opentelemetry/proto/trace/v1/trace.proto
# File contains JSON representation of OTLP TracesData.
# Contents look like:
# {"resourceSpans":[
# {"resource": {"attributes":[{"key":"service.name","value":{"stringValue":"s3-benchrunner-rust"}}, ...]},
# "scopeSpans":[
# {"scope":{"name":"s3-benchrunner-rust"},
# "spans":[
# {"traceId":"0e506aee98c24b869337620977f30cbb","spanId":"6fb4c16d1d1652d6", ...},
# {"traceId":"0e506aee98c24b869337620977f30cbb","spanId":"6440f82fb6fc6299", ...},
# ...
#
# Official protobuf format specified here:
# https://github.com/open-telemetry/opentelemetry-proto/blob/main/opentelemetry/proto/trace/v1/trace.proto
#
# Note that when proto data is mapped to JSON, snake_case names become camelCase
# see: https://protobuf.dev/programming-guides/proto3/#json
Expand Down
2 changes: 2 additions & 0 deletions runners/s3-benchrunner-rust/graph/allspans.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ def draw(data):

name = span['name']
# we want each span in its own row, so assign a unique name and use that as Y value
# TODO: improve unique name, using "seq" or "part-num"
name_count[name] += 1
unique_name = f"{name}#{name_count[name]}"

Expand Down Expand Up @@ -60,6 +61,7 @@ def draw(data):
y='Unique Name',
hover_data=hover_data,
# spans with same original name get same color
# TODO: combine name with code.namespace, in case same name used in multiple places
color='Name',
# force ordering, otherwise plotly will group by 'color'
category_orders={'Unique Name': df['Unique Name']},
Expand Down

0 comments on commit 06e4ca4

Please sign in to comment.