X Tutup
The Wayback Machine - https://web.archive.org/web/20220321204739/https://github.com/nodejs/node/commit/43f2abae7c
Skip to content
Permalink
Browse files
src: slightly simplify V8CoverageConnection::GetFilename
PR-URL: #41748
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Mestery <mestery@protonmail.com>
  • Loading branch information
addaleax authored and ruyadorno committed Feb 8, 2022
1 parent 869cbb7 commit 43f2abae7c98e60b2b15fe2c7a27e84688c21cf2
Showing with 6 additions and 12 deletions.
  1. +6 −12 src/inspector_profiler.cc
@@ -170,18 +170,12 @@ static bool EnsureDirectory(const std::string& directory, const char* type) {
}

std::string V8CoverageConnection::GetFilename() const {
std::string thread_id = std::to_string(env()->thread_id());
std::string pid = std::to_string(uv_os_getpid());
std::string timestamp = std::to_string(
static_cast<uint64_t>(GetCurrentTimeInMicroseconds() / 1000));
char filename[1024];
snprintf(filename,
sizeof(filename),
"coverage-%s-%s-%s.json",
pid.c_str(),
timestamp.c_str(),
thread_id.c_str());
return filename;
uint64_t timestamp =
static_cast<uint64_t>(GetCurrentTimeInMicroseconds() / 1000);
return SPrintF("coverage-%s-%s-%s.json",
uv_os_getpid(),
timestamp,
env()->thread_id());
}

void V8ProfilerConnection::WriteProfile(Local<Object> result) {

0 comments on commit 43f2aba

Please sign in to comment.
X Tutup