Android-cuttlefish cvd tool
utils.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2023 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16#pragma once
17
18#include <string.h>
19
20#include <clientanalytics.pb.h>
21
22#include "cuttlefish/host/commands/metrics/metrics_defs.h"
23
24namespace metrics {
25enum ClearcutServer : int {
26 kLocal = 0,
28 kProd = 2,
29};
30
31std::string GetOsName();
32std::string GetOsVersion();
33std::string GenerateSessionId(uint64_t now);
34std::string GetCfVersion();
35std::string GetMacAddress();
36std::string GetCompany();
37std::string GetVmmVersion();
38uint64_t GetEpochTimeMs();
39std::string ProtoToString(cuttlefish::LogEvent* event);
40cuttlefish::MetricsExitCodes PostRequest(const std::string& output,
41 ClearcutServer server);
42
43} // namespace metrics
Event event
Definition: kernel_log_server.cc:56
MetricsExitCodes
Definition: metrics_defs.h:20
Definition: utils.cpp:39
std::string GetMacAddress()
Definition: utils.cpp:74
std::string GetOsName()
Definition: utils.cpp:46
std::string GetOsVersion()
Definition: utils.cpp:65
std::string GetCfVersion()
Definition: utils.cpp:60
std::string GetCompany()
Definition: utils.cpp:116
uint64_t GetEpochTimeMs()
Definition: utils.cpp:126
ClearcutServer
Definition: utils.h:25
@ kLocal
Definition: utils.h:26
@ kStaging
Definition: utils.h:27
@ kProd
Definition: utils.h:28
MetricsExitCodes PostRequest(const std::string &output, metrics::ClearcutServer server)
Definition: utils.cpp:164
std::string ProtoToString(cuttlefish::LogEvent *event)
std::string GenerateSessionId(uint64_t now_ms)
Definition: utils.cpp:55
std::string GetVmmVersion()
Definition: utils.cpp:121
double now()
Definition: util.cpp:45