Skip to content

Commit

Permalink
Fix typo for text:///tmp/reproxy_log.txt
Browse files Browse the repository at this point in the history
The valid flag value log_path should be either:
1) reducedtext:///tmp/reproxy_log.rrpl
or
2) text:///tmp/reproxy_log.rpl

See http://shortn/_sh70VpI4bH. Note that we are not going to support other format of log files rather than rrpl and rpl: http://shortn/_MSOkGuiN9a

Bug: b/279056853
Test: Unit test and integ test
Change-Id: I1eabe6bbde913e94887d6507d71282634aaff3ed
GitOrigin-RevId: f234b4f9699d9a8e553171a1708d8a4a4987cb1f
  • Loading branch information
ywmei-brt1 authored and copybara-github committed Aug 8, 2024
1 parent 752f999 commit 0b324f1
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ tests/integ/testdata/chromium/RE_CLIENT_CHROMIUM_DIR
# MacOS, ignore the .DS_Store files it puts everywhere
.DS_Store

# Directory in which bigquery schema corresponding to reproxy_log.txt
# is generated by scripts/gen_reproxy_log_bigquery_schema.sh
# Directory in which bigquery schema is generated by scripts/gen_reproxy_log_bigquery_schema.sh
reproxy_log_bigquery_schema

# Ignore codelab outputs
Expand Down
8 changes: 6 additions & 2 deletions cmd/bigquery/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,16 @@

// Binary biqeury is used to stream an reproxy_log generated from a build
// using re-client to bigquery so that it can be further queried upon.
// Note that due to b/279056853, we only support TextFormat and ReducedTextFormat
// log files. Valid log_path could be (see: http://shortn/_3fVE7Zeuey):
// 1. --log_path text:///tmp/reproxy_log.rpl
// 2. --log_path reducedtext:///tmp/reproxy_log.rrpl

/*
Example invocation (assuming the bigquery table already exists):
bazelisk run //cmd/bigquery:bigquery -- \
--log_path text:///tmp/reproxy_log.txt \
--log_path text:///tmp/reproxy_log.rpl \
--alsologtostderr=true \
--table <bigquery-dataset-id>.<bigquery-table-id> \
--project_id <gcp-project-id> # (ex:"foundry-x-experiments")
Expand Down Expand Up @@ -60,7 +64,7 @@ var (
bqTableSpec = flag.String("bq_table", "reproxy_log_test.test_1", "Table where log records are stored.")
// 8M byte limit for marshaled JSON data is empirically derived. BigQuery's REST API has a 10M upload payload limit, but JSON encoding adds overhead.
bqBatchMB = flag.Int("bq_batch_mb", 8, "Batch size in MB for bigquery uploading, defaults to 8MB and should not be larger than 8 MB")
logPath = flag.String("log_path", "", "If provided, the path to a log file of all executed records. The format is e.g. text:///full/file/path.")
logPath = flag.String("log_path", "", "If provided, the path to a log file of all executed records. The format is e.g. text:///full/file/path.rpl.")
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion cmd/rpl2cloudtrace/rpl2cloudtrace.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ import (

var (
proxyLogDir []string
logPath = flag.String("log_path", "", "Path to reproxy_log.txt file. E.g., text:///tmp/reproxy_log.txt")
logPath = flag.String("log_path", "", "Path to reproxy_log.rpl file. E.g., text:///tmp/reproxy_log.rpl")
logFormat = flag.String("log_format", "text", "Format of proxy log. Currently only text is supported.")
projectID = flag.String("project_id", os.Getenv("GOOGLE_CLOUD_PROJECT"), "project id for cloud trace")

Expand Down
2 changes: 1 addition & 1 deletion cmd/rpl2trace/rpl2trace.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ import (

var (
proxyLogDir []string
logPath = flag.String("log_path", "", "Path to reproxy_log.txt file. E.g., text:///tmp/reproxy_log.txt")
logPath = flag.String("log_path", "", "Path to reproxy_log.rpl file. E.g., text:///tmp/reproxy_log.rpl")
logFormat = flag.String("log_format", "text", "Format of proxy log. Currently only text is supported.")
outputFilename = flag.String("output", "trace.json", "output filename")
traceLevel = flag.Int("trace_level", 3, "trace level. 0=cmd req. 1=local only. 2=local+remote, 3=local+remote+worker")
Expand Down

0 comments on commit 0b324f1

Please sign in to comment.