Skip to content

Added requesttype request statistics#13571

Open
rlin1214 wants to merge 2 commits into
CesiumGS:mainfrom
rlin1214:request-type-statistics
Open

Added requesttype request statistics#13571
rlin1214 wants to merge 2 commits into
CesiumGS:mainfrom
rlin1214:request-type-statistics

Conversation

@rlin1214

@rlin1214 rlin1214 commented Jun 15, 2026

Copy link
Copy Markdown

Description

This change adds per-request-type statistics to RequestScheduler using the existing RequestType enum.

Previously, RequestType values were assigned to requests and propagated through the request pipeline, but they were not used for debugging, logging, or statistics collection. This change tracks the number of requests by type and reports them through the existing debugShowStatistics mechanism.

The following request categories are tracked:

-Terrain requests
-Imagery requests
-3D Tiles requests
-Other requests

These statistics can help developers better understand request distribution and provide more fine-grained debugging information when analyzing application behavior.

Issue number and link

fixes issue #13048

Testing plan

-Added request-type counters to the RequestScheduler statistics object.
-Incremented counters when requests are processed by RequestScheduler.request.
-Added logging of request-type statistics when RequestScheduler.debugShowStatistics is enabled.
-Reset counters after logging to match the behavior of existing statistics.
-Started the Cesium development server and opened Sandcastle.
-Enabled statistics reporting and verified that imagery, terrain, 3D Tiles, and other request counts were logged correctly.
-Verified that counters reset after reporting and did not accumulate indefinitely.

Author checklist

  • I have submitted a Contributor License Agreement
  • I have added my name to CONTRIBUTORS.md
  • I have updated CHANGES.md with a short summary of my change
  • I have added or updated unit tests to ensure consistent code coverage
  • I have updated the inline documentation, and included code examples where relevant
  • I have performed a self-review of my code

AI acknowledgment

  • I used AI to generate content in this PR
  • If yes, I have reviewed the AI-generated content before submitting

If yes, I used the following Tools(s) and/or Service(s):

ChatGPT

If yes, I used the following Model(s):

GPT-5.5

@github-actions

Copy link
Copy Markdown
Contributor

Thank you for the pull request, @rlin1214! Welcome to the Cesium community!

In order for us to review your PR, please complete the following steps:

Review Pull Request Guidelines to make sure your PR gets accepted quickly.

@rlin1214

Copy link
Copy Markdown
Author

I have completed these steps,

  • I have submitted a Contributor License Agreement
  • I have added my name to CONTRIBUTORS.md
  • I have updated CHANGES.md with a short summary of my change

@ggetz

ggetz commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

I can confirm we now have a CLA on file for @rlin1214!

@javagl

javagl commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

The issue originally suggested removing the RequestType, because it was not used. This change goes beyond that: It changes the implementation so that the RequestType is in fact used.

But as also mentioned in the issue: I could imagine that this could be useful for tracking more fine-grained information. And this seems to be well aligned with efforts that are related to ~"better benchmarking and performance tests". (Roughly: When we find out that too much time is spent with too many requests, it could be helpful to know which types of requests that are).

So I'd lean towards merging this, ... @ggetz ... unless you disagree.

(Until now, I only skimmed over the code, and it looks straightforward - if this is something that we'd like to have, I'd do a proper review+test tomorrow)

@ggetz

ggetz commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

I agree that this change, while different than the original suggestion, is overall a helpful one.

As an aside, I wonder if the intention of the RequestScheduler was, at one point or in the future, intended to have budgets for different types of requests like what is implemented in JobScheduler. I could see that proving useful for preventing one type of request from starving another, such as reported in #4166. This is all beyond the scope of this PR, however.

@ggetz ggetz 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.

Overall, the code updates here look clean. 👍

@rlin1214 There are a few cleanup tasks needed before this can be merged. Could you please:

  • Write one or more unit tests in RequestSchedulerSpec to confirm the new debug behavior
  • Merge in main
  • Move the bullet in CHANGES.md to the next scheduled release, 1.144

@rlin1214

rlin1214 commented Jul 6, 2026 via email

Copy link
Copy Markdown
Author

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.

3 participants