-
Notifications
You must be signed in to change notification settings - Fork 119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added new cloud statistics facility. #25
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,7 @@ | |
|
||
#include "cloud/aws/aws_env.h" | ||
#include "cloud/aws/aws_file.h" | ||
#include "rocksdb/cloud/cloud_statistics.h" | ||
#include "util/coding.h" | ||
#include "util/stderr_logger.h" | ||
#include "util/string_util.h" | ||
|
@@ -464,6 +465,13 @@ Status S3WritableFile::CopyManifestToS3(uint64_t size_hint, bool force) { | |
"[s3] S3WritableFile made manifest %s durable to " | ||
"bucket %s bucketpath %s.", | ||
fname_.c_str(), s3_bucket_.c_str(), s3_object_.c_str()); | ||
|
||
// If cloud stats are present, record the manifest write and its latency in millis. | ||
auto stats = env_->cloud_env_options.cloud_statistics; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Pls use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On a related note, check out second paragraph here: http://smalldatum.blogspot.com/2016/10/make-myrocks-2x-less-slow.html |
||
if (stats) { | ||
stats->recordTick(NUMBER_MANIFEST_WRITES, 1); | ||
stats->measureTime(MANIFEST_WRITES_TIME, env_->s3client_result_.micros / 1000); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you just measure time here instead of piggy-backing on the time measure in S3 callback? That would make the code much easier to reason about (no need for thread-local, wrapping the callback, etc). Also, you already have the start time of the operation recorded in line 455, so adding an extra time call shouldn't be a big concern. |
||
} | ||
} else { | ||
Log(InfoLogLevel::ERROR_LEVEL, env_->info_log_, | ||
"[s3] S3WritableFile failed to make manifest %s durable to " | ||
|
@@ -472,6 +480,7 @@ Status S3WritableFile::CopyManifestToS3(uint64_t size_hint, bool force) { | |
stat.ToString().c_str()); | ||
} | ||
} | ||
|
||
return stat; | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately we cannot use thread_local, since RocksDB can run on platforms that don't support it. We can use
__thread
, but only in some scenarios, check out how RocksDB does it: https://github.com/facebook/rocksdb/blob/master/monitoring/perf_context.cc#L20