mirror of
https://github.com/facebook/sapling.git
synced 2024-10-09 16:31:02 +03:00
afddf66676
Summary: Refactoring to make the following diff smaller. Reviewed By: chadaustin Differential Revision: D27522581 fbshipit-source-id: 8f858714fcbfe4b8f8b1c3678bb2003623abbd94
29 lines
542 B
C++
29 lines
542 B
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.
|
|
*/
|
|
|
|
#include "eden/fs/telemetry/SessionId.h"
|
|
#include <random>
|
|
|
|
namespace {
|
|
|
|
uint32_t generateSessionId() {
|
|
std::random_device rd;
|
|
std::uniform_int_distribution<uint32_t> u;
|
|
return u(rd);
|
|
}
|
|
|
|
} // namespace
|
|
|
|
namespace facebook::eden {
|
|
|
|
uint32_t getSessionId() {
|
|
static auto sessionId = generateSessionId();
|
|
return sessionId;
|
|
}
|
|
|
|
} // namespace facebook::eden
|