mirror of
https://github.com/facebook/sapling.git
synced 2024-10-05 14:28:17 +03:00
32679fb9a1
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
51 lines
1.2 KiB
C++
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
|