sapling/eden/fs/telemetry/SessionInfo.h
Katie Mancini 32679fb9a1 log architecture on macOS to edenfs_events
Summary:
It's not possible to differentiate NFS m1 and intel users in edenfs_events
right now. We are currently rolling out to intel users and it would be good
to understand the real number of intel users on NFS vs fuse.

Let's log the cpu architecture so that we can differentiate them.

Reviewed By: mshroyer

Differential Revision: D39139996

fbshipit-source-id: 582804707a7816c41aa6c69594f7198d3ce5dfe1
2022-08-31 11:57:28 -07:00

51 lines
1.2 KiB
C++

/*
* Copyright (c) Meta Platforms, Inc. and 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::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;
#ifdef __APPLE__
std::string systemArchitecture;
#endif
};
std::string getOperatingSystemName();
std::string getOperatingSystemVersion();
#if defined(__APPLE__)
std::string getOperatingSystemArchitecture();
#endif
/**
* 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 facebook::eden