GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — src: slightly simplify V8CoverageConnection::GetFilename · nodejs/node@206c370

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • src
    • inspector_profiler.cc
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/inspector_profiler.cc‎

Copy file name to clipboardExpand all lines: src/inspector_profiler.cc
+6-12Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -170,18 +170,12 @@ static bool EnsureDirectory(const std::string& directory, const char* type) {
170170
}
171171

172172
std::string V8CoverageConnection::GetFilename() const {
173-
std::string thread_id = std::to_string(env()->thread_id());
174-
std::string pid = std::to_string(uv_os_getpid());
175-
std::string timestamp = std::to_string(
176-
static_cast<uint64_t>(GetCurrentTimeInMicroseconds() / 1000));
177-
char filename[1024];
178-
snprintf(filename,
179-
sizeof(filename),
180-
"coverage-%s-%s-%s.json",
181-
pid.c_str(),
182-
timestamp.c_str(),
183-
thread_id.c_str());
184-
return filename;
173+
uint64_t timestamp =
174+
static_cast<uint64_t>(GetCurrentTimeInMicroseconds() / 1000);
175+
return SPrintF("coverage-%s-%s-%s.json",
176+
uv_os_getpid(),
177+
timestamp,
178+
env()->thread_id());
185179
}
186180

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

0 commit comments

Comments
0 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.