sapling/eden/fs/telemetry/SessionInfo.h
Stiopa Koltsov a252bb1307 follow-up to sandcastle_instance_id
Summary:
* use `std::nullopt`
* TODO about sandcastle_instance_id in opensource version

Reviewed By: chadaustin

Differential Revision: D27575732

fbshipit-source-id: bf76970a15fee5a3dc1e4e411ea70f5af7248496
2021-04-06 13:14:12 -07:00

47 lines
1.1 KiB
C++

/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This software may be used and distributed according to the terms of the
* GNU General Public License version 2.
*/
#pragma once
#include <cstdint>
#include <optional>
#include <string>
namespace facebook {
namespace eden {
struct SessionInfo {
std::string username;
std::string hostname;
// TODO(nga): sandcastle is Facebook-specific, should not be used in
// opensource version.
std::optional<uint64_t> sandcastleInstanceId;
std::string os;
std::string osVersion;
std::string edenVersion;
};
std::string getOperatingSystemName();
std::string getOperatingSystemVersion();
/**
* Returns the result of calling gethostname() in a std::string. Throws an
* exception on failure.
*/
std::string getHostname();
/**
* Return the best guess of sandcastle instance id from the environment,
* or return empty if sandcastle instance id is unknown.
*/
// TODO(nga): sandcastle is Facebook-specific, should not be used in
// opensource version.
std::optional<uint64_t> getSandcastleInstanceId();
} // namespace eden
} // namespace facebook