Android-cuttlefish cvd tool
utils.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2022 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
20
21namespace cuttlefish::metrics {
22
23enum ClearcutServer : int {
24 kLocal = 0,
26 kProd = 2,
27};
28
29std::string GetOsName();
30std::string GetOsVersion();
31std::string GenerateSessionId(uint64_t now);
32std::string GetCfVersion();
33std::string GetMacAddress();
34std::string GetCompany();
35std::string GetVmmVersion();
36uint64_t GetEpochTimeMs();
37std::string ProtoToString(LogEvent* event);
38MetricsExitCodes PostRequest(const std::string& output, ClearcutServer server);
39
40} // namespace cuttlefish::metrics
Definition: utils.cc:38
std::string GetOsName()
Definition: utils.cc:45
std::string GetCfVersion()
Definition: utils.cc:59
uint64_t GetEpochTimeMs()
Definition: utils.cc:125
std::string GetMacAddress()
Definition: utils.cc:73
std::string GetCompany()
Definition: utils.cc:115
std::string ProtoToString(LogEvent *event)
MetricsExitCodes PostRequest(const std::string &output, metrics::ClearcutServer server)
Definition: utils.cc:163
std::string GetOsVersion()
Definition: utils.cc:64
ClearcutServer
Definition: utils.h:23
@ kLocal
Definition: utils.h:24
@ kStaging
Definition: utils.h:25
@ kProd
Definition: utils.h:26
std::string GenerateSessionId(uint64_t now_ms)
Definition: utils.cc:54
std::string GetVmmVersion()
Definition: utils.cc:120
Event event
Definition: kernel_log_server.cc:56
MetricsExitCodes
Definition: metrics_defs.h:20
double now()
Definition: util.cpp:45