Skip to content

Add startup latency measurement script#4819

Merged
geertj merged 1 commit into
GoogleCloudPlatform:masterfrom
geertj:startup-latency-script
Jun 30, 2026
Merged

Add startup latency measurement script#4819
geertj merged 1 commit into
GoogleCloudPlatform:masterfrom
geertj:startup-latency-script

Conversation

@geertj

@geertj geertj commented Jun 27, 2026

Copy link
Copy Markdown
Collaborator

This script measures the startup latency of gcsfuse by launching it in a subprocess, polling the mount point until its device ID (st_dev) changes, and recording the elapsed time.

Examples of running the script:

  1. With HNS enabled (default): $ python3 perfmetrics/scripts/startup_latency/startup_latency.py \ --bucket-name geertj-us-central1-a --mount-point ./mnt Startup latency: 360.27 ms

  2. With HNS disabled: $ python3 perfmetrics/scripts/startup_latency/startup_latency.py \ --bucket-name geertj-us-central1-a --mount-point ./mnt \ --flags="--enable-hns=false" Startup latency: 28.55 ms

TAG=agy
CONV=cebcc159-cc87-4c47-b800-09dc13fad1ec

@geertj geertj requested review from a team and meet2mky as code owners June 27, 2026 22:59
@geertj geertj requested a review from raj-prince June 27, 2026 22:59
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a diagnostic utility designed to quantify the startup performance of gcsfuse. By automating the mounting process and tracking the time taken for the mount point to become active, it provides a reliable way to benchmark startup times under various configurations.

Highlights

  • New Performance Tool: Added a Python script to measure the startup latency of gcsfuse by monitoring device ID changes at the mount point.
  • Process Management: The script handles gcsfuse process lifecycle, including forced foreground execution, cleanup via unmounting, and timeout management.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@github-actions

Copy link
Copy Markdown

Hey there and thank you for opening this pull request! 👋🏼

We require pull request titles to follow the Conventional Commits specification and it looks like your proposed title needs to be adjusted.

Details:

No release type found in pull request title "Add startup latency measurement script". Add a prefix to indicate what kind of release this pull request corresponds to. For reference, see https://www.conventionalcommits.org/

Available types:
 - feat: A new feature
 - fix: A bug fix
 - docs: Documentation only changes
 - style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
 - refactor: A code change that neither fixes a bug nor adds a feature
 - perf: A code change that improves performance
 - test: Adding missing tests or correcting existing tests
 - build: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
 - ci: Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
 - chore: Other changes that don't modify src or test files
 - revert: Reverts a previous commit

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new Python script, startup_latency.py, designed to measure the startup latency of gcsfuse by monitoring the mount point's device ID. The review feedback highlights critical issues in the process management of measure_startup_latency, including potential deadlocks from calling process.wait() unconditionally, a potential NameError if subprocess.Popen fails, and a potential FileNotFoundError if fusermount is missing. A robust refactoring is suggested to safely handle process execution, timeouts, and cleanup.

Comment thread perfmetrics/scripts/startup_latency/startup_latency.py Outdated
@geertj geertj force-pushed the startup-latency-script branch 2 times, most recently from 50065e5 to 3775d47 Compare June 27, 2026 23:08
This script measures the startup latency of gcsfuse by launching it in a
subprocess, polling the mount point until its device ID (st_dev) changes,
and recording the elapsed time.

Examples of running the script:

1. With HNS enabled (default):
   $ python3 perfmetrics/scripts/startup_latency/startup_latency.py \
       --bucket-name geertj-us-central1-a --mount-point ./mnt
   Startup latency: 360.27 ms

2. With HNS disabled:
   $ python3 perfmetrics/scripts/startup_latency/startup_latency.py \
       --bucket-name geertj-us-central1-a --mount-point ./mnt \
       --flags="--enable-hns=false"
   Startup latency: 28.55 ms

TAG=agy
CONV=cebcc159-cc87-4c47-b800-09dc13fad1ec
@geertj geertj force-pushed the startup-latency-script branch from 3775d47 to 3721839 Compare June 27, 2026 23:13
@geertj geertj requested a review from charith87 June 29, 2026 19:30

@charith87 charith87 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Standalone script. Seems fine.

@geertj geertj merged commit 460e999 into GoogleCloudPlatform:master Jun 30, 2026
12 checks passed
raj-prince pushed a commit that referenced this pull request Jul 1, 2026
This script measures the startup latency of gcsfuse by launching it in a
subprocess, polling the mount point until its device ID (st_dev) changes,
and recording the elapsed time.

Examples of running the script:

1. With HNS enabled (default):
   $ python3 perfmetrics/scripts/startup_latency/startup_latency.py \
       --bucket-name geertj-us-central1-a --mount-point ./mnt
   Startup latency: 360.27 ms

2. With HNS disabled:
   $ python3 perfmetrics/scripts/startup_latency/startup_latency.py \
       --bucket-name geertj-us-central1-a --mount-point ./mnt \
       --flags="--enable-hns=false"
   Startup latency: 28.55 ms

TAG=agy
CONV=cebcc159-cc87-4c47-b800-09dc13fad1ec
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants