[llvm] [llvm]Add a simple Telemetry framework (PR #102323)
James Henderson via llvm-commits
llvm-commits at lists.llvm.org
Tue Dec 17 01:40:39 PST 2024
================
@@ -112,71 +108,71 @@ To use Telemetry in your tool, you need to provide a concrete implementation of
writeHelper(KeyName, Value);
}
- void write(StringRef KeyName, size_t Value) override {
+ void write(StringRef KeyName, unsigned long long Value) override {
writeHelper(KeyName, Value);
}
void write(StringRef KeyName, StringRef Value) override {
writeHelper(KeyName, Value);
}
void write(StringRef KeyName,
- const std::map<std::string, std::string>& Value) override {
+ const std::map<std::string, std::string> &Value) override {
json::Object Inner;
- for (auto kv : Value) {
- Inner.try_emplace(kv.first, kv.second);
+ for (auto KV : Value) {
+ Inner.try_emplace(KV.first, KV.second);
}
writeHelper(KeyName, json::Value(std::move(Inner)));
}
Error finalize() override {
- if (!started)
+ if (!Started)
return createStringError("Serializer not currently in use");
- started = false;
+ Started = false;
return Error::success();
}
private:
template <typename T> void writeHelper(StringRef Name, T Value) {
assert(started && "serializer not started");
- object->try_emplace(Name, Value);
+ Out->try_emplace(Name, Value);
}
- bool started = false;
- std::unique_ptr<json::Object> object;
+ bool Started = false;
+ std::unique_ptr<json::Object> Out;
};
class MyManager : public telemery::Manager {
public:
- static std::unique_ptr<MyManager> createInstatnce(telemetry::Config* config) {
+ static std::unique_ptr<MyManager> createInstatnce(telemetry::Config *config) {
----------------
jh7370 wrote:
`config` -> `Config`
https://github.com/llvm/llvm-project/pull/102323
More information about the llvm-commits
mailing list