-
Notifications
You must be signed in to change notification settings - Fork 481
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
Percona telemetry #5243
Percona telemetry #5243
Conversation
REQUIRES_SERVICE_PLACEHOLDER_AS(component_sys_variable_unregister, | ||
component_sys_variable_unregister_srv); | ||
|
||
static std::unique_ptr<PerconaTelemetryComponent> percona_telemetry_component; |
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.
anonymous namespace can be used for a group of static declarations
namespace {
...
} // anonymous namespace
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.
what is the advantage?
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.
Just stylistic.
Instead of
static int a;
static int b;
...
you can write
namespace {
int a;
int b;
...
}
Basically, you don't have to put static
keyword on each declaration.
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.
I'm still not fully convinced, but let's do it in modern way as you said :)
- Symbols in unnamed namespaces are exported from the library anyway, but their names are randomly mangled. This can cause the linker to do its job longer.
- Maybe I'm old-school, but when I see
static
, I exactly know, what it means in all possible contexts. Having an unnamed namespace it is not instantly clear what the function scope is. - If there is only one static variable/function, wrapping it with an anonymous namespace seems to be too verbose. Using
static
in such a case seems to be violating rules: we should use one or another way of limiting the scope, not mixing to avoid mess. - Looks like C++ committee undepreciated use of
static
afbd3aa
to
b567438
Compare
468d4b8
to
f12bca2
Compare
f12bca2
to
0067401
Compare
REQUIRES_SERVICE_PLACEHOLDER_AS(component_sys_variable_unregister, | ||
component_sys_variable_unregister_srv); | ||
|
||
static std::unique_ptr<PerconaTelemetryComponent> percona_telemetry_component; |
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.
Just stylistic.
Instead of
static int a;
static int b;
...
you can write
namespace {
int a;
int b;
...
}
Basically, you don't have to put static
keyword on each declaration.
std::filesystem::path::preferred_separator; | ||
|
||
// Let's keep it as std::string, because there is no way to string + string_vew | ||
static const std::string TMP_FILE_EXTENSION(".tmp"); |
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.
could be std::string_view
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.
// history_keep_interval | ||
// 2. This is someone's else file, but it is older than the highest | ||
// possible history_keep_interval | ||
if (our_file && (file_timestamp < oldest_timestamp)) { |
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.
Up to you but a few comments:
- std::time_t is an unspecified type, so it may not be long.
- Even if it is long, this is a SIGNED type which may not be what you expect (as you may have already noticed I don't like signed types :) )
- For instance a difference between 2 timestamps may be negative (in case of clock change / ntp adjustments).
d63fe80
to
2cc495f
Compare
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.
LGTM
2cc495f
to
83723c3
Compare
TEL-46: MySql telemetry component creates telemetry files with not sufficient r/w privileges for TA Problem: Depending on OS configuration, MySql component can create telemetry files with permissions not enough for TA to read their content (e.g. 600). It is required to have permissions mask at least 644. TA deletes files after processing, but deletion permission is a matter of the directory mask, not the file itself. Solution: Storage component adds needed permissions after file creation.
https://perconadev.atlassian.net/browse/PS-9165 Updated copyright info.
abaa584
to
515468d
Compare
2cdd70f
into
percona:release-8.0.37-29
No description provided.