Skip to content

Usage reporting - #627

Merged
alan412 merged 2 commits into
wpilibsuite:mainfrom
alan412:usage_reporting
Nov 11, 2026
Merged

alan412 merged 2 commits into
wpilibsuite:mainfrom
alan412:usage_reporting

Conversation

@alan412

@alan412 alan412 commented Nov 10, 2026 •

Copy link
Copy Markdown
Collaborator

Overview

This does the first pass of some simple usage reporting when run on an FMS. It reports everything under a "Blocks" key and reports it as JSON. For a sample project I had, it looked like this:

{
    "version": "0.8.2",
    "libraries": {},
    "blocks": {
        "controls_if": 5,
        "logic_compare": 1,
        "logic_negate": 1,
        "logic_operation": 3,
        "logic_ternary": 1,
        "math_number": 3,
        "mrc_call_python_function": 9,
        "mrc_class_method_def": 7,
        "mrc_component": 1,
        "mrc_gamepad_analog": 1,
        "mrc_gamepad_boolean": 8,
        "mrc_get_python_variable": 9,
        "mrc_mechanism": 1,
        "mrc_mechanism_component_holder": 2,
        "mrc_opmode_details": 1,
        "text": 12
    },
    "components": {
        "wpilib.AnalogEncoder": 1
    }
}

I originally the number and types of modules but I figured that was redundant because there is always 1 robot. The number of opmodes is equal to the number of mrc_opmode_details, and the number of mechanisms is equal to the number of mrc_mechanism_component_holder - 1 (since the robot also has one)

Looking at this, is it going to bother us not knowing more about the what the python function calls are? Will we want to know how many of the class method defines were overrides vs custom?

Linked Issues

Closes #618

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that causes existing functionality to change)
  • Documentation update
  • Code style/formatting updates
  • Refactoring / Renaming
  • UI change
  • Blocks style change
  • Blocks theme change
  • Python tools
  • Other

How Has This Been Tested?

I only downloaded it, I didn't try a deploy on Systemcore yet.

Screenshots (if applicable)

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have run through the docs/testing_before_pr_checklist.md

@alan412
alan412 marked this pull request as ready for review November 11, 2026 17:02
@alan412
alan412 merged commit 72ffc9b into wpilibsuite:main Nov 11, 2026
1 check passed
@alan412
alan412 deleted the usage_reporting branch November 11, 2026 22:22
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.

Add usage reporting

2 participants