From 7dbd0fbc17af58729c2431ea479dbc5a7d6daf8d Mon Sep 17 00:00:00 2001 From: kkeirstead <85592574+kkeirstead@users.noreply.github.com> Date: Mon, 2 Oct 2023 10:29:25 -0700 Subject: [PATCH 01/44] Put Learning Path In-Progress Staleness Checker Back In Main * Create check-learning-path-links.yml * Update check-learning-path-links.yml * Update check-learning-path-links.yml * Update check-learning-path-links.yml * Update check-learning-path-links.yml * Update ActivityExtensions.cs * Update check-learning-path-links.yml * Update check-learning-path-links.yml * Update check-learning-path-links.yml * Update check-learning-path-links.yml * Update check-learning-path-links.yml * Update check-learning-path-links.yml * Update check-learning-path-links.yml * Update check-learning-path-links.yml * Update check-learning-path-links.yml * Update check-learning-path-links.yml * Update check-learning-path-links.yml * Update check-learning-path-links.yml * Update check-learning-path-links.yml * Update submit-linter-suggestions.yml * Update submit-linter-suggestions.yml * Create submit-learning-paths-staleness-check.yml * Update check-learning-path-links.yml * Update check-learning-path-links.yml * Update check-learning-path-links.yml * Update submit-learning-paths-staleness-check.yml * Update submit-learning-paths-staleness-check.yml * Update submit-learning-paths-staleness-check.yml * Update submit-learning-paths-staleness-check.yml * Update submit-learning-paths-staleness-check.yml * Update submit-learning-paths-staleness-check.yml * Update submit-learning-paths-staleness-check.yml * Update submit-learning-paths-staleness-check.yml * Update submit-learning-paths-staleness-check.yml * Update submit-learning-paths-staleness-check.yml * Update submit-learning-paths-staleness-check.yml * Update check-learning-path-links.yml * Update submit-learning-paths-staleness-check.yml * Update submit-learning-paths-staleness-check.yml * Update submit-learning-paths-staleness-check.yml * Update check-learning-path-links.yml * Update submit-learning-paths-staleness-check.yml * Update submit-learning-paths-staleness-check.yml * Update submit-learning-paths-staleness-check.yml * Update submit-learning-paths-staleness-check.yml * Update submit-learning-paths-staleness-check.yml * Update submit-learning-paths-staleness-check.yml * Update submit-learning-paths-staleness-check.yml * Update submit-learning-paths-staleness-check.yml * Update submit-learning-paths-staleness-check.yml * Update submit-learning-paths-staleness-check.yml * Update submit-learning-paths-staleness-check.yml * Update submit-learning-paths-staleness-check.yml * Update submit-learning-paths-staleness-check.yml * Update check-learning-path-links.yml * Update submit-learning-paths-staleness-check.yml * Update submit-learning-paths-staleness-check.yml * Update submit-learning-paths-staleness-check.yml * Update TestAssemblies.cs * Update CollectionRulePipeline.cs * Update submit-learning-paths-staleness-check.yml * Update CollectionRulePipeline.cs * Update CollectionRulePipeline.cs * Update submit-learning-paths-staleness-check.yml * Update ActivityExtensions.cs * Update CollectionRulePipeline.cs * Update TestAssemblies.cs --- .../workflows/check-learning-path-links.yml | 75 ++++++++++++++++++ .../submit-learning-paths-staleness-check.yml | 76 +++++++++++++++++++ .../workflows/submit-linter-suggestions.yml | 9 ++- 3 files changed, 159 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/check-learning-path-links.yml create mode 100644 .github/workflows/submit-learning-paths-staleness-check.yml diff --git a/.github/workflows/check-learning-path-links.yml b/.github/workflows/check-learning-path-links.yml new file mode 100644 index 00000000000..e2b3154574e --- /dev/null +++ b/.github/workflows/check-learning-path-links.yml @@ -0,0 +1,75 @@ +name: 'Check Learning Path Links' +on: + pull_request: + branches: ['main'] + +permissions: + pull-requests: read + +jobs: + check-learning-path-links: + name: 'Check Learning Path Links' + runs-on: ubuntu-latest + + steps: + - name: Checkout merge + uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab + with: + persist-credentials: false + path: merge + + - name: Checkout head + uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab + with: + persist-credentials: false + ref: main + path: head + + - name: Get base commit for the PR + working-directory: ./merge + run: | + git fetch origin "$GITHUB_BASE_REF" + base_sha=$(git rev-parse "origin/$GITHUB_BASE_REF") + echo "base_sha=$base_sha" >> $GITHUB_ENV + echo "Merging ${GITHUB_SHA} into ${GITHUB_BASE_REF}" + + - name: Get changed files + working-directory: ./merge + run: | + changed_source_files=$(git diff-tree --no-commit-id --name-only -r "$base_sha" "$GITHUB_SHA" | { grep "**.cs$" || test $? = 1; }) + echo "Files to validate: '${changed_source_files}'" + echo "updated_files=$(echo ${changed_source_files})" >> $GITHUB_ENV + + - name: Check Learning Path Links + id: check-links + uses: kkeirstead/LearningPathFileChecks@main + with: + repoURLToSearch: 'https://github.com/dotnet/dotnet-monitor' + learningPathsDirectory: 'documentation/learningPath' + paths: ${{ env.updated_files }} + + - name: Generate artifacts (Suggestion) + working-directory: ./merge + run: | + mkdir -p ./pr + cp "$GITHUB_EVENT_PATH" ./pr/pr-event.json + git diff > ./pr/linter.diff + + - name: Generate artifacts (Comment) + working-directory: ./merge + run: | + mkdir -p ./learning-path-review + echo -n "${{ steps.check-links.outputs.modifiedFiles }}" > ./learning-path-review/modifiedFiles + echo -n "${{ steps.check-links.outputs.manuallyReview }}" > ./learning-path-review/manuallyReview + + - name: Upload artifacts (Suggestion) + uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce + with: + name: pr-linter + path: merge/pr/ + + - name: Upload artifacts (Comment) + uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce + with: + name: learning-path-review + path: merge/learning-path-review/ diff --git a/.github/workflows/submit-learning-paths-staleness-check.yml b/.github/workflows/submit-learning-paths-staleness-check.yml new file mode 100644 index 00000000000..da3e649acd2 --- /dev/null +++ b/.github/workflows/submit-learning-paths-staleness-check.yml @@ -0,0 +1,76 @@ +name: 'Submit Learning Paths Staleness Check' + +on: + workflow_run: + workflows: ["Check Learning Path Links"] + types: + - completed + +permissions: + contents: write + issues: write + pull-requests: write + + +jobs: + submit-learning-paths-staleness-check: + if: github.event.workflow_run.conclusion == 'success' + runs-on: ubuntu-latest + permissions: + contents: write + issues: write + pull-requests: write + + steps: + - uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 + id: check-user + with: + script: | + await github.rest.repos.checkCollaborator({ + owner: context.repo.owner, + repo: context.repo.repo, + username: context.payload.workflow_run.triggering_actor.login + }); + + - name: Checkout + uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab + with: + persist-credentials: true + + # Download the artifact from the workflow that kicked off this one. + # The default artifact download action doesn't support cross-workflow + # artifacts, so use a 3rd party one. + - name: 'Download linting results' + uses: dawidd6/action-download-artifact@246dbf436b23d7c49e21a7ab8204ca9ecd1fe615 + with: + workflow: ${{env.workflow_name}} + run_id: ${{github.event.workflow_run.id }} + name: learning-path-review + path: ./learning-path-review + + - name: Set Env Vars + run: | + modifiedFiles=$(cat ./learning-path-review/modifiedFiles) + manuallyReview=$(cat ./learning-path-review/manuallyReview) + echo "modifiedFiles=$modifiedFiles" >> $GITHUB_ENV + echo "manuallyReview=$manuallyReview" >> $GITHUB_ENV + + - uses: actions/github-script@v6 + name: Submit Comment + if: ${{ env.modifiedFiles != '' }} + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + MODIFIED_FILES: ${{ env.modifiedFiles }} + MANUALLY_REVIEW: ${{ env.manuallyReview }} + with: + script: | + modifiedFiles = process.env.MODIFIED_FILES; + manuallyReview = process.env.MANUALLY_REVIEW; + comment_body = "### Learning Paths Links Check \n\nChanged files in the Learning Path:\n\n" + modifiedFiles.replaceAll(",", "\n") + "\n\n---------\n\n Files that should be manually reviewed:\n\n" + manuallyReview.replaceAll(",", "\n"); + github.rest.issues.createComment({ + issue_number: context.payload.workflow_run.pull_requests[0].number, + owner: context.repo.owner, + repo: context.repo.repo, + body: comment_body + }) + diff --git a/.github/workflows/submit-linter-suggestions.yml b/.github/workflows/submit-linter-suggestions.yml index 54f080d0938..b68a99aec33 100644 --- a/.github/workflows/submit-linter-suggestions.yml +++ b/.github/workflows/submit-linter-suggestions.yml @@ -2,7 +2,7 @@ name: 'Submit linter suggestions' on: workflow_run: - workflows: ["C# linting", "Add Markdown Feedback"] + workflows: ["C# linting", "Add Markdown Feedback", "Check Learning Path Links"] types: - completed @@ -45,6 +45,13 @@ jobs: run: | echo 'reporter_name=Add Markdown Feedback' >> $GITHUB_ENV echo 'workflow_name=add-markdown-feedback.yml' >> $GITHUB_ENV + + - name: Set Learning Path File Checks Env Vars + if: ${{ github.event.workflow_run.name == 'Check Learning Path Links' }} + run: | + echo 'reporter_name=Learning Path File Checks' >> $GITHUB_ENV + echo 'workflow_name=check-learning-path-links.yml' >> $GITHUB_ENV + # Download the artifact from the workflow that kicked off this one. # The default artifact download action doesn't support cross-workflow # artifacts, so use a 3rd party one. From 0d45cbdb446d0544fa7de2818240e1e5fe33f5a9 Mon Sep 17 00:00:00 2001 From: kkeirstead <85592574+kkeirstead@users.noreply.github.com> Date: Mon, 2 Oct 2023 11:05:48 -0700 Subject: [PATCH 02/44] Update architecture.md --- documentation/learningPath/architecture.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/documentation/learningPath/architecture.md b/documentation/learningPath/architecture.md index 38476ca861c..cdaa40cb3d4 100644 --- a/documentation/learningPath/architecture.md +++ b/documentation/learningPath/architecture.md @@ -2,3 +2,10 @@ ### Was this documentation helpful? [Share feedback](https://www.research.net/r/DGDQWXH?src=documentation%2FlearningPath%2Farchitecture) # Architecture +This is a test of a deleted [file](https://github.com/dotnet/dotnet-monitor/blob/v7.0.1/src/Tools/dotnet-monitor/OutputFormat.cs). + +This is a test of a shifted line [file](https://github.com/dotnet/dotnet-monitor/blob/v7.0.1/src/Tools/dotnet-monitor/CollectionRules/Options/CollectionRuleTriggerOptions.cs#L20). + +This is a test of a removed line [file](https://github.com/dotnet/dotnet-monitor/blob/v7.0.1/src/Tools/dotnet-monitor/CollectionRules/Options/CollectionRuleTriggerOptions.cs#L1). + +This is a test of an ambiguous line [file](https://github.com/dotnet/dotnet-monitor/blob/v7.0.1/src/Tools/dotnet-monitor/CollectionRules/Options/CollectionRuleTriggerOptions.cs#L16). From 67cf5095fd1f78e25156d43e7e08fba9e5605713 Mon Sep 17 00:00:00 2001 From: kkeirstead <85592574+kkeirstead@users.noreply.github.com> Date: Mon, 2 Oct 2023 13:05:00 -0700 Subject: [PATCH 03/44] Update collectionrules.md --- documentation/learningPath/collectionrules.md | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/documentation/learningPath/collectionrules.md b/documentation/learningPath/collectionrules.md index 6ea6c9ce47e..f361f22053b 100644 --- a/documentation/learningPath/collectionrules.md +++ b/documentation/learningPath/collectionrules.md @@ -32,49 +32,49 @@ graph LR ### Key Areas Of The Code -* Collection rules are registered [here](https://github.com/dotnet/dotnet-monitor/blob/v7.0.1/src/Tools/dotnet-monitor/ServiceCollectionExtensions.cs#L100). When adding a new trigger or action, these types need to be added here to take effect. This section is also responsible for making sure options get configured and validated. -* Options for collection rules can be found [here](https://github.com/dotnet/dotnet-monitor/blob/v7.0.1/src/Tools/dotnet-monitor/CollectionRules/Options/CollectionRuleOptions.cs). -* Rules are applied, removed, and restarted in response to configuration changes [here](https://github.com/dotnet/dotnet-monitor/blob/v7.0.1/src/Tools/dotnet-monitor/CollectionRules/CollectionRuleService.cs). This is also responsible for generating a description of each collection rule's state for the `/collectionrules` API Endpoint. -* The pipeline responsible for the lifetime of a single executing collection rule can be found [here](https://github.com/dotnet/dotnet-monitor/blob/v7.0.1/src/Tools/dotnet-monitor/CollectionRules/CollectionRulePipeline.cs#L55). -* To run collection rules, `dotnet monitor` must be in `Listen` mode - this is set via [DiagnosticPortOptions](https://github.com/dotnet/dotnet-monitor/blob/v7.0.1/src/Microsoft.Diagnostics.Monitoring.Options/DiagnosticPortOptions.cs). +* Collection rules are registered [here](https://github.com/dotnet/dotnet-monitor/blob/main/src/Tools/dotnet-monitor/ServiceCollectionExtensions.cs#L100). When adding a new trigger or action, these types need to be added here to take effect. This section is also responsible for making sure options get configured and validated. +* Options for collection rules can be found [here](https://github.com/dotnet/dotnet-monitor/blob/main/src/Tools/dotnet-monitor/CollectionRules/Options/CollectionRuleOptions.cs). +* Rules are applied, removed, and restarted in response to configuration changes [here](https://github.com/dotnet/dotnet-monitor/blob/main/src/Tools/dotnet-monitor/CollectionRules/CollectionRuleService.cs). This is also responsible for generating a description of each collection rule's state for the `/collectionrules` API Endpoint. +* The pipeline responsible for the lifetime of a single executing collection rule can be found [here](https://github.com/dotnet/dotnet-monitor/blob/main/src/Tools/dotnet-monitor/CollectionRules/CollectionRulePipeline.cs#L55). +* To run collection rules, `dotnet monitor` must be in `Listen` mode - this is set via [DiagnosticPortOptions](https://github.com/dotnet/dotnet-monitor/blob/main/src/Microsoft.Diagnostics.Monitoring.Options/DiagnosticPortOptions.cs). * For each type of trigger, the [dotnet diagnostics repo](https://github.com/dotnet/diagnostics/blob/v6.0.351802/src/Microsoft.Diagnostics.Monitoring.EventPipe/Triggers/ITraceEventTrigger.cs#L29) is responsible for determining whether the triggering conditions have been satisfied. ### Triggers -A trigger will monitor for a specific condition in the target application and raise a notification when that condition has been observed. Options for triggers can be found [here](https://github.com/dotnet/dotnet-monitor/blob/v7.0.1/src/Tools/dotnet-monitor/CollectionRules/Options/CollectionRuleTriggerOptions.cs); the type of `Settings` is determined by which trigger is being used (possible trigger types can be found [here](https://github.com/dotnet/dotnet-monitor/tree/v7.0.1/src/Tools/dotnet-monitor/CollectionRules/Options/Triggers)). The interface for all triggers can be found [here](https://github.com/dotnet/dotnet-monitor/blob/v7.0.1/src/Tools/dotnet-monitor/CollectionRules/Triggers/ICollectionRuleTrigger.cs) - this allows `dotnet monitor` to start and stop triggers, regardless of the trigger's properties. The collection rule pipeline creates instances of triggers [here](https://github.com/dotnet/dotnet-monitor/blob/v7.0.1/src/Tools/dotnet-monitor/CollectionRules/CollectionRulePipeline.cs#L100) before waiting for the trigger to [satisfy its conditions](https://github.com/dotnet/diagnostics/blob/v6.0.351802/src/Microsoft.Diagnostics.Monitoring.EventPipe/Triggers/Pipelines/TraceEventTriggerPipeline.cs#L107) - each trigger has its own set of criteria that determines when a trigger has been satisfied. +A trigger will monitor for a specific condition in the target application and raise a notification when that condition has been observed. Options for triggers can be found [here](https://github.com/dotnet/dotnet-monitor/blob/main/src/Tools/dotnet-monitor/CollectionRules/Options/CollectionRuleTriggerOptions.cs); the type of `Settings` is determined by which trigger is being used (possible trigger types can be found [here](https://github.com/dotnet/dotnet-monitor/tree/main/src/Tools/dotnet-monitor/CollectionRules/Options/Triggers)). The interface for all triggers can be found [here](https://github.com/dotnet/dotnet-monitor/blob/main/src/Tools/dotnet-monitor/CollectionRules/Triggers/ICollectionRuleTrigger.cs) - this allows `dotnet monitor` to start and stop triggers, regardless of the trigger's properties. The collection rule pipeline creates instances of triggers [here](https://github.com/dotnet/dotnet-monitor/blob/main/src/Tools/dotnet-monitor/CollectionRules/CollectionRulePipeline.cs#L100) before waiting for the trigger to [satisfy its conditions](https://github.com/dotnet/diagnostics/blob/v6.0.351802/src/Microsoft.Diagnostics.Monitoring.EventPipe/Triggers/Pipelines/TraceEventTriggerPipeline.cs#L107) - each trigger has its own set of criteria that determines when a trigger has been satisfied. ### Actions -Actions allow executing an operation or an external executable in response to a trigger condition being satisfied. Options for actions can be found [here](https://github.com/dotnet/dotnet-monitor/blob/v7.0.1/src/Tools/dotnet-monitor/CollectionRules/Options/CollectionRuleActionOptions.cs); the type of `Settings` is determined by which action is being used (possible action types can be found [here](https://github.com/dotnet/dotnet-monitor/tree/v7.0.1/src/Tools/dotnet-monitor/CollectionRules/Options/Actions)). The interface for all actions can be found [here](https://github.com/dotnet/dotnet-monitor/blob/v7.0.1/src/Tools/dotnet-monitor/CollectionRules/Actions/ICollectionRuleAction.cs) - this allows `dotnet monitor` to start an action, wait for it to complete, and get its output values regardless of the action's properties. The action list is [executed](https://github.com/dotnet/dotnet-monitor/blob/v7.0.1/src/Tools/dotnet-monitor/CollectionRules/CollectionRulePipeline.cs#L150) once the triggering condition has been met (assuming the action list isn't throttled), with each action by default starting without waiting for prior actions to complete. +Actions allow executing an operation or an external executable in response to a trigger condition being satisfied. Options for actions can be found [here](https://github.com/dotnet/dotnet-monitor/blob/main/src/Tools/dotnet-monitor/CollectionRules/Options/CollectionRuleActionOptions.cs); the type of `Settings` is determined by which action is being used (possible action types can be found [here](https://github.com/dotnet/dotnet-monitor/tree/main/src/Tools/dotnet-monitor/CollectionRules/Options/Actions)). The interface for all actions can be found [here](https://github.com/dotnet/dotnet-monitor/blob/main/src/Tools/dotnet-monitor/CollectionRules/Actions/ICollectionRuleAction.cs) - this allows `dotnet monitor` to start an action, wait for it to complete, and get its output values regardless of the action's properties. The action list is [executed](https://github.com/dotnet/dotnet-monitor/blob/main/src/Tools/dotnet-monitor/CollectionRules/CollectionRulePipeline.cs#L150) once the triggering condition has been met (assuming the action list isn't throttled), with each action by default starting without waiting for prior actions to complete. ### Filters -Filters can optionally be applied to a collection rule to choose which processes can trigger the rule. This uses the same set of [options](https://github.com/dotnet/dotnet-monitor/blob/v7.0.1/src/Microsoft.Diagnostics.Monitoring.Options/ProcessFilterOptions.cs#L47) as setting the default process for `dotnet-monitor`. When starting a collection rule, [these filters are used to check if the current process should have the collection rule applied to it](https://github.com/dotnet/dotnet-monitor/blob/v7.0.1/src/Tools/dotnet-monitor/CollectionRules/CollectionRuleContainer.cs#L189); if so, the collection rule starts. +Filters can optionally be applied to a collection rule to choose which processes can trigger the rule. This uses the same set of [options](https://github.com/dotnet/dotnet-monitor/blob/main/src/Microsoft.Diagnostics.Monitoring.Options/ProcessFilterOptions.cs#L47) as setting the default process for `dotnet-monitor`. When starting a collection rule, [these filters are used to check if the current process should have the collection rule applied to it](https://github.com/dotnet/dotnet-monitor/blob/main/src/Tools/dotnet-monitor/CollectionRules/CollectionRuleContainer.cs#L189); if so, the collection rule starts. ### Limits -Limits can optionally be applied to a collection rule to constrain the lifetime of the rule and how often its actions can be run before being throttled. Options for limits can be found [here](https://github.com/dotnet/dotnet-monitor/blob/v7.0.1/src/Tools/dotnet-monitor/CollectionRules/Options/CollectionRuleLimitsOptions.cs). When provided (or when using default values), limits are evaluated in the collection rule pipeline while running. `RuleDuration` is used to [create a token](https://github.com/dotnet/dotnet-monitor/blob/v7.0.1/src/Tools/dotnet-monitor/CollectionRules/CollectionRulePipeline.cs#L80) that shuts down the pipeline. `ActionCountSlidingWindowDuration` does not rely on setting cancellation tokens; rather, the number of executions within the sliding window are checked on-demand [here](https://github.com/dotnet/dotnet-monitor/blob/v7.0.1/src/Microsoft.Diagnostics.Monitoring.WebApi/CollectionRulePipelineState.cs#L212), and `ActionCount` is referenced to determine whether the rule needs to [terminate](https://github.com/dotnet/dotnet-monitor/blob/v7.0.1/src/Microsoft.Diagnostics.Monitoring.WebApi/CollectionRulePipelineState.cs#L195) or [throttle](https://github.com/dotnet/dotnet-monitor/blob/v7.0.1/src/Microsoft.Diagnostics.Monitoring.WebApi/CollectionRulePipelineState.cs#L235). +Limits can optionally be applied to a collection rule to constrain the lifetime of the rule and how often its actions can be run before being throttled. Options for limits can be found [here](https://github.com/dotnet/dotnet-monitor/blob/main/src/Tools/dotnet-monitor/CollectionRules/Options/CollectionRuleLimitsOptions.cs). When provided (or when using default values), limits are evaluated in the collection rule pipeline while running. `RuleDuration` is used to [create a token](https://github.com/dotnet/dotnet-monitor/blob/main/src/Tools/dotnet-monitor/CollectionRules/CollectionRulePipeline.cs#L80) that shuts down the pipeline. `ActionCountSlidingWindowDuration` does not rely on setting cancellation tokens; rather, the number of executions within the sliding window are checked on-demand [here](https://github.com/dotnet/dotnet-monitor/blob/main/src/Microsoft.Diagnostics.Monitoring.WebApi/CollectionRulePipelineState.cs#L212), and `ActionCount` is referenced to determine whether the rule needs to [terminate](https://github.com/dotnet/dotnet-monitor/blob/main/src/Microsoft.Diagnostics.Monitoring.WebApi/CollectionRulePipelineState.cs#L195) or [throttle](https://github.com/dotnet/dotnet-monitor/blob/main/src/Microsoft.Diagnostics.Monitoring.WebApi/CollectionRulePipelineState.cs#L235). ## Miscellaneous ### Trigger Shortcuts -Trigger Shortcuts provide improved defaults, range validation, and a simpler syntax for [several commonly used `EventCounter` triggers](https://github.com/dotnet/dotnet-monitor/tree/v7.0.1/src/Tools/dotnet-monitor/CollectionRules/Options/Triggers/EventCounterShortcuts). These shortcuts provide the same functionality as using the standard `EventCounter` syntax, but have fewer available options (since there is no need to specify the `ProviderName` or the `CounterName`) - as a result, shortcuts do not inherit from `EventCounterOptions`, but rather [IEventCounterShortcuts](https://github.com/dotnet/dotnet-monitor/blob/v7.0.1/src/Tools/dotnet-monitor/CollectionRules/Options/Triggers/EventCounterShortcuts/IEventCounterShortcuts.cs). Each type of shortcut is registered independently [here](https://github.com/dotnet/dotnet-monitor/blob/v7.0.1/src/Tools/dotnet-monitor/ServiceCollectionExtensions.cs#L117). After binding with configuration and undergoing validation, shortcuts are then converted to be treated as `EventCounter` triggers [here](https://github.com/dotnet/dotnet-monitor/blob/v7.0.1/src/Tools/dotnet-monitor/CollectionRules/Triggers/EventCounterTriggerFactory.cs), using their respective defaults instead of the generic ones. +Trigger Shortcuts provide improved defaults, range validation, and a simpler syntax for [several commonly used `EventCounter` triggers](https://github.com/dotnet/dotnet-monitor/tree/main/src/Tools/dotnet-monitor/CollectionRules/Options/Triggers/EventCounterShortcuts). These shortcuts provide the same functionality as using the standard `EventCounter` syntax, but have fewer available options (since there is no need to specify the `ProviderName` or the `CounterName`) - as a result, shortcuts do not inherit from `EventCounterOptions`, but rather [IEventCounterShortcuts](https://github.com/dotnet/dotnet-monitor/blob/main/src/Tools/dotnet-monitor/CollectionRules/Options/Triggers/EventCounterShortcuts/IEventCounterShortcuts.cs). Each type of shortcut is registered independently [here](https://github.com/dotnet/dotnet-monitor/blob/main/src/Tools/dotnet-monitor/ServiceCollectionExtensions.cs#L117). After binding with configuration and undergoing validation, shortcuts are then converted to be treated as `EventCounter` triggers [here](https://github.com/dotnet/dotnet-monitor/blob/main/src/Tools/dotnet-monitor/CollectionRules/Triggers/EventCounterTriggerFactory.cs), using their respective defaults instead of the generic ones. ### Templates -Templates allow users to design reusable collection rule components by associating a name with a piece of configuration. Options for templates can be found [here](https://github.com/dotnet/dotnet-monitor/blob/v7.0.1/src/Tools/dotnet-monitor/CollectionRules/Options/TemplateOptions.cs). Before collection rules undergo validation, `dotnet monitor` checks to see if any of the rule's components in configuration [list the name of a template](https://github.com/dotnet/dotnet-monitor/blob/v7.0.1/src/Tools/dotnet-monitor/CollectionRules/Configuration/CollectionRulePostConfigureNamedOptions.cs) - if so, the collection rule's options are populated from the correspondingly named template. Note that templates undergo the same binding process for triggers/actions as collection rules; however, since templates are treated as separate parts of configuration, this binding instead happens [here](https://github.com/dotnet/dotnet-monitor/blob/v7.0.1/src/Tools/dotnet-monitor/CollectionRules/Configuration/TemplatesConfigureNamedOptions.cs). +Templates allow users to design reusable collection rule components by associating a name with a piece of configuration. Options for templates can be found [here](https://github.com/dotnet/dotnet-monitor/blob/main/src/Tools/dotnet-monitor/CollectionRules/Options/TemplateOptions.cs). Before collection rules undergo validation, `dotnet monitor` checks to see if any of the rule's components in configuration [list the name of a template](https://github.com/dotnet/dotnet-monitor/blob/main/src/Tools/dotnet-monitor/CollectionRules/Configuration/CollectionRulePostConfigureNamedOptions.cs) - if so, the collection rule's options are populated from the correspondingly named template. Note that templates undergo the same binding process for triggers/actions as collection rules; however, since templates are treated as separate parts of configuration, this binding instead happens [here](https://github.com/dotnet/dotnet-monitor/blob/main/src/Tools/dotnet-monitor/CollectionRules/Configuration/TemplatesConfigureNamedOptions.cs). ### Collection Rule Defaults -Defaults can be used to limit the verbosity of configuration, allowing frequently used values for collection rules to be assigned as defaults. Options for collection rule defaults can be found [here](https://github.com/dotnet/dotnet-monitor/blob/v7.0.1/src/Tools/dotnet-monitor/CollectionRules/Options/CollectionRuleDefaultsOptions.cs). These defaults are merged with the user's provided configuration [here](https://github.com/dotnet/dotnet-monitor/blob/v7.0.1/src/Tools/dotnet-monitor/CollectionRules/Options/DefaultCollectionRulePostConfigureOptions.cs) - any properties that the user hasn't set (that have corresponding default values) will be updated at this point to use the default values. This step occurs prior to `dotnet monitor` attempting to use its built-in defaults, which allows user defaults to take precedence. +Defaults can be used to limit the verbosity of configuration, allowing frequently used values for collection rules to be assigned as defaults. Options for collection rule defaults can be found [here](https://github.com/dotnet/dotnet-monitor/blob/main/src/Tools/dotnet-monitor/CollectionRules/Options/CollectionRuleDefaultsOptions.cs). These defaults are merged with the user's provided configuration [here](https://github.com/dotnet/dotnet-monitor/blob/main/src/Tools/dotnet-monitor/CollectionRules/Options/DefaultCollectionRulePostConfigureOptions.cs) - any properties that the user hasn't set (that have corresponding default values) will be updated at this point to use the default values. This step occurs prior to `dotnet monitor` attempting to use its built-in defaults, which allows user defaults to take precedence. ### Collection Rule API Endpoint -The Collection Rule API Endpoint allows users to get information about the state of their collection rules, providing general information [here](https://github.com/dotnet/dotnet-monitor/blob/v7.0.1/src/Microsoft.Diagnostics.Monitoring.WebApi/Controllers/DiagController.cs#L532) and more specific information about a particular rule [here](https://github.com/dotnet/dotnet-monitor/blob/v7.0.1/src/Microsoft.Diagnostics.Monitoring.WebApi/Controllers/DiagController.cs#L557). **This API is solely for viewing the current state of rules, not altering state**. +The Collection Rule API Endpoint allows users to get information about the state of their collection rules, providing general information [here](https://github.com/dotnet/dotnet-monitor/blob/main/src/Microsoft.Diagnostics.Monitoring.WebApi/Controllers/DiagController.cs#L532) and more specific information about a particular rule [here](https://github.com/dotnet/dotnet-monitor/blob/main/src/Microsoft.Diagnostics.Monitoring.WebApi/Controllers/DiagController.cs#L557). **This API is solely for viewing the current state of rules, not altering state**. -Each collection rule pipeline has a [state holder](https://github.com/dotnet/dotnet-monitor/blob/v7.0.1/src/Microsoft.Diagnostics.Monitoring.WebApi/CollectionRulePipelineState.cs) that keeps track of the rule's execution. By keeping track of the pipeline's state in real-time, this state doesn't need to be calculated in response to a user hitting the `/collectionrules` endpoint. However, other user-facing information, such as countdowns, are calculated on-demand - these values are solely for display purposes and not used by `dotnet-monitor` when determining when to change state (see [Limits](#limits) for more information). +Each collection rule pipeline has a [state holder](https://github.com/dotnet/dotnet-monitor/blob/main/src/Microsoft.Diagnostics.Monitoring.WebApi/CollectionRulePipelineState.cs) that keeps track of the rule's execution. By keeping track of the pipeline's state in real-time, this state doesn't need to be calculated in response to a user hitting the `/collectionrules` endpoint. However, other user-facing information, such as countdowns, are calculated on-demand - these values are solely for display purposes and not used by `dotnet-monitor` when determining when to change state (see [Limits](#limits) for more information). ## Keeping Documentation Up-To-Date -When making changes to collection rules that require updates to configuration, these changes should be added [here](https://github.com/dotnet/dotnet-monitor/blob/v7.0.1/documentation/configuration.md#collection-rule-configuration). Additional information on collection rules and examples can be provided [here](https://github.com/dotnet/dotnet-monitor/tree/v7.0.1/documentation/collectionrules). +When making changes to collection rules that require updates to configuration, these changes should be added [here](https://github.com/dotnet/dotnet-monitor/blob/main/documentation/configuration.md#collection-rule-configuration). Additional information on collection rules and examples can be provided [here](https://github.com/dotnet/dotnet-monitor/tree/main/documentation/collectionrules). From 167398964a1a90b8577d3ed8328459e4594a3d0a Mon Sep 17 00:00:00 2001 From: kkeirstead <85592574+kkeirstead@users.noreply.github.com> Date: Mon, 2 Oct 2023 13:08:41 -0700 Subject: [PATCH 04/44] Update collectionrules.md --- documentation/learningPath/collectionrules.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/documentation/learningPath/collectionrules.md b/documentation/learningPath/collectionrules.md index f361f22053b..dc7c0f8becb 100644 --- a/documentation/learningPath/collectionrules.md +++ b/documentation/learningPath/collectionrules.md @@ -35,17 +35,17 @@ graph LR * Collection rules are registered [here](https://github.com/dotnet/dotnet-monitor/blob/main/src/Tools/dotnet-monitor/ServiceCollectionExtensions.cs#L100). When adding a new trigger or action, these types need to be added here to take effect. This section is also responsible for making sure options get configured and validated. * Options for collection rules can be found [here](https://github.com/dotnet/dotnet-monitor/blob/main/src/Tools/dotnet-monitor/CollectionRules/Options/CollectionRuleOptions.cs). * Rules are applied, removed, and restarted in response to configuration changes [here](https://github.com/dotnet/dotnet-monitor/blob/main/src/Tools/dotnet-monitor/CollectionRules/CollectionRuleService.cs). This is also responsible for generating a description of each collection rule's state for the `/collectionrules` API Endpoint. -* The pipeline responsible for the lifetime of a single executing collection rule can be found [here](https://github.com/dotnet/dotnet-monitor/blob/main/src/Tools/dotnet-monitor/CollectionRules/CollectionRulePipeline.cs#L55). +* The pipeline responsible for the lifetime of a single executing collection rule can be found [here](https://github.com/dotnet/dotnet-monitor/blob/main/src/Tools/dotnet-monitor/CollectionRules/CollectionRulePipeline.cs#L54). * To run collection rules, `dotnet monitor` must be in `Listen` mode - this is set via [DiagnosticPortOptions](https://github.com/dotnet/dotnet-monitor/blob/main/src/Microsoft.Diagnostics.Monitoring.Options/DiagnosticPortOptions.cs). * For each type of trigger, the [dotnet diagnostics repo](https://github.com/dotnet/diagnostics/blob/v6.0.351802/src/Microsoft.Diagnostics.Monitoring.EventPipe/Triggers/ITraceEventTrigger.cs#L29) is responsible for determining whether the triggering conditions have been satisfied. ### Triggers -A trigger will monitor for a specific condition in the target application and raise a notification when that condition has been observed. Options for triggers can be found [here](https://github.com/dotnet/dotnet-monitor/blob/main/src/Tools/dotnet-monitor/CollectionRules/Options/CollectionRuleTriggerOptions.cs); the type of `Settings` is determined by which trigger is being used (possible trigger types can be found [here](https://github.com/dotnet/dotnet-monitor/tree/main/src/Tools/dotnet-monitor/CollectionRules/Options/Triggers)). The interface for all triggers can be found [here](https://github.com/dotnet/dotnet-monitor/blob/main/src/Tools/dotnet-monitor/CollectionRules/Triggers/ICollectionRuleTrigger.cs) - this allows `dotnet monitor` to start and stop triggers, regardless of the trigger's properties. The collection rule pipeline creates instances of triggers [here](https://github.com/dotnet/dotnet-monitor/blob/main/src/Tools/dotnet-monitor/CollectionRules/CollectionRulePipeline.cs#L100) before waiting for the trigger to [satisfy its conditions](https://github.com/dotnet/diagnostics/blob/v6.0.351802/src/Microsoft.Diagnostics.Monitoring.EventPipe/Triggers/Pipelines/TraceEventTriggerPipeline.cs#L107) - each trigger has its own set of criteria that determines when a trigger has been satisfied. +A trigger will monitor for a specific condition in the target application and raise a notification when that condition has been observed. Options for triggers can be found [here](https://github.com/dotnet/dotnet-monitor/blob/main/src/Tools/dotnet-monitor/CollectionRules/Options/CollectionRuleTriggerOptions.cs); the type of `Settings` is determined by which trigger is being used (possible trigger types can be found [here](https://github.com/dotnet/dotnet-monitor/tree/main/src/Tools/dotnet-monitor/CollectionRules/Options/Triggers)). The interface for all triggers can be found [here](https://github.com/dotnet/dotnet-monitor/blob/main/src/Tools/dotnet-monitor/CollectionRules/Triggers/ICollectionRuleTrigger.cs) - this allows `dotnet monitor` to start and stop triggers, regardless of the trigger's properties. The collection rule pipeline creates instances of triggers [here](https://github.com/dotnet/dotnet-monitor/blob/main/src/Tools/dotnet-monitor/CollectionRules/CollectionRulePipeline.cs#L99) before waiting for the trigger to [satisfy its conditions](https://github.com/dotnet/diagnostics/blob/v6.0.351802/src/Microsoft.Diagnostics.Monitoring.EventPipe/Triggers/Pipelines/TraceEventTriggerPipeline.cs#L107) - each trigger has its own set of criteria that determines when a trigger has been satisfied. ### Actions -Actions allow executing an operation or an external executable in response to a trigger condition being satisfied. Options for actions can be found [here](https://github.com/dotnet/dotnet-monitor/blob/main/src/Tools/dotnet-monitor/CollectionRules/Options/CollectionRuleActionOptions.cs); the type of `Settings` is determined by which action is being used (possible action types can be found [here](https://github.com/dotnet/dotnet-monitor/tree/main/src/Tools/dotnet-monitor/CollectionRules/Options/Actions)). The interface for all actions can be found [here](https://github.com/dotnet/dotnet-monitor/blob/main/src/Tools/dotnet-monitor/CollectionRules/Actions/ICollectionRuleAction.cs) - this allows `dotnet monitor` to start an action, wait for it to complete, and get its output values regardless of the action's properties. The action list is [executed](https://github.com/dotnet/dotnet-monitor/blob/main/src/Tools/dotnet-monitor/CollectionRules/CollectionRulePipeline.cs#L150) once the triggering condition has been met (assuming the action list isn't throttled), with each action by default starting without waiting for prior actions to complete. +Actions allow executing an operation or an external executable in response to a trigger condition being satisfied. Options for actions can be found [here](https://github.com/dotnet/dotnet-monitor/blob/main/src/Tools/dotnet-monitor/CollectionRules/Options/CollectionRuleActionOptions.cs); the type of `Settings` is determined by which action is being used (possible action types can be found [here](https://github.com/dotnet/dotnet-monitor/tree/main/src/Tools/dotnet-monitor/CollectionRules/Options/Actions)). The interface for all actions can be found [here](https://github.com/dotnet/dotnet-monitor/blob/main/src/Tools/dotnet-monitor/CollectionRules/Actions/ICollectionRuleAction.cs) - this allows `dotnet monitor` to start an action, wait for it to complete, and get its output values regardless of the action's properties. The action list is [executed](https://github.com/dotnet/dotnet-monitor/blob/main/src/Tools/dotnet-monitor/CollectionRules/CollectionRulePipeline.cs#L149) once the triggering condition has been met (assuming the action list isn't throttled), with each action by default starting without waiting for prior actions to complete. ### Filters @@ -53,7 +53,7 @@ Filters can optionally be applied to a collection rule to choose which processes ### Limits -Limits can optionally be applied to a collection rule to constrain the lifetime of the rule and how often its actions can be run before being throttled. Options for limits can be found [here](https://github.com/dotnet/dotnet-monitor/blob/main/src/Tools/dotnet-monitor/CollectionRules/Options/CollectionRuleLimitsOptions.cs). When provided (or when using default values), limits are evaluated in the collection rule pipeline while running. `RuleDuration` is used to [create a token](https://github.com/dotnet/dotnet-monitor/blob/main/src/Tools/dotnet-monitor/CollectionRules/CollectionRulePipeline.cs#L80) that shuts down the pipeline. `ActionCountSlidingWindowDuration` does not rely on setting cancellation tokens; rather, the number of executions within the sliding window are checked on-demand [here](https://github.com/dotnet/dotnet-monitor/blob/main/src/Microsoft.Diagnostics.Monitoring.WebApi/CollectionRulePipelineState.cs#L212), and `ActionCount` is referenced to determine whether the rule needs to [terminate](https://github.com/dotnet/dotnet-monitor/blob/main/src/Microsoft.Diagnostics.Monitoring.WebApi/CollectionRulePipelineState.cs#L195) or [throttle](https://github.com/dotnet/dotnet-monitor/blob/main/src/Microsoft.Diagnostics.Monitoring.WebApi/CollectionRulePipelineState.cs#L235). +Limits can optionally be applied to a collection rule to constrain the lifetime of the rule and how often its actions can be run before being throttled. Options for limits can be found [here](https://github.com/dotnet/dotnet-monitor/blob/main/src/Tools/dotnet-monitor/CollectionRules/Options/CollectionRuleLimitsOptions.cs). When provided (or when using default values), limits are evaluated in the collection rule pipeline while running. `RuleDuration` is used to [create a token](https://github.com/dotnet/dotnet-monitor/blob/main/src/Tools/dotnet-monitor/CollectionRules/CollectionRulePipeline.cs#L79) that shuts down the pipeline. `ActionCountSlidingWindowDuration` does not rely on setting cancellation tokens; rather, the number of executions within the sliding window are checked on-demand [here](https://github.com/dotnet/dotnet-monitor/blob/main/src/Microsoft.Diagnostics.Monitoring.WebApi/CollectionRulePipelineState.cs#L212), and `ActionCount` is referenced to determine whether the rule needs to [terminate](https://github.com/dotnet/dotnet-monitor/blob/main/src/Microsoft.Diagnostics.Monitoring.WebApi/CollectionRulePipelineState.cs#L195) or [throttle](https://github.com/dotnet/dotnet-monitor/blob/main/src/Microsoft.Diagnostics.Monitoring.WebApi/CollectionRulePipelineState.cs#L235). ## Miscellaneous From 5b5de00aba4736711df92a189f0fb5ce8a290965 Mon Sep 17 00:00:00 2001 From: kkeirstead <85592574+kkeirstead@users.noreply.github.com> Date: Mon, 2 Oct 2023 14:10:55 -0700 Subject: [PATCH 05/44] Update check-learning-path-links.yml --- .github/workflows/check-learning-path-links.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/check-learning-path-links.yml b/.github/workflows/check-learning-path-links.yml index e2b3154574e..fd4ce368a75 100644 --- a/.github/workflows/check-learning-path-links.yml +++ b/.github/workflows/check-learning-path-links.yml @@ -63,13 +63,13 @@ jobs: echo -n "${{ steps.check-links.outputs.manuallyReview }}" > ./learning-path-review/manuallyReview - name: Upload artifacts (Suggestion) - uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce + uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 with: name: pr-linter path: merge/pr/ - name: Upload artifacts (Comment) - uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce + uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 with: name: learning-path-review path: merge/learning-path-review/ From 9ce6f72379bd86512ca68d02d04fbc3116fc6b99 Mon Sep 17 00:00:00 2001 From: kkeirstead <85592574+kkeirstead@users.noreply.github.com> Date: Tue, 3 Oct 2023 07:27:44 -0700 Subject: [PATCH 06/44] Update check-learning-path-links.yml --- .github/workflows/check-learning-path-links.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/check-learning-path-links.yml b/.github/workflows/check-learning-path-links.yml index fd4ce368a75..d8219bc73ea 100644 --- a/.github/workflows/check-learning-path-links.yml +++ b/.github/workflows/check-learning-path-links.yml @@ -8,6 +8,7 @@ permissions: jobs: check-learning-path-links: + if: contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.pull_request.author_association) name: 'Check Learning Path Links' runs-on: ubuntu-latest From 0598e8ac1eac589b47c946f6b2b4d1c585c50e27 Mon Sep 17 00:00:00 2001 From: kkeirstead <85592574+kkeirstead@users.noreply.github.com> Date: Tue, 3 Oct 2023 07:28:25 -0700 Subject: [PATCH 07/44] Update check-learning-path-links.yml --- .github/workflows/check-learning-path-links.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/check-learning-path-links.yml b/.github/workflows/check-learning-path-links.yml index d8219bc73ea..26cb1b62042 100644 --- a/.github/workflows/check-learning-path-links.yml +++ b/.github/workflows/check-learning-path-links.yml @@ -14,13 +14,13 @@ jobs: steps: - name: Checkout merge - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab + uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac with: persist-credentials: false path: merge - name: Checkout head - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab + uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac with: persist-credentials: false ref: main From 88ac5749c9c273535eb5c007cf8555de9fea75e2 Mon Sep 17 00:00:00 2001 From: kkeirstead <85592574+kkeirstead@users.noreply.github.com> Date: Tue, 3 Oct 2023 07:36:48 -0700 Subject: [PATCH 08/44] Update submit-linter-suggestions.yml --- .github/workflows/submit-linter-suggestions.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/submit-linter-suggestions.yml b/.github/workflows/submit-linter-suggestions.yml index b68a99aec33..4b52001ac1f 100644 --- a/.github/workflows/submit-linter-suggestions.yml +++ b/.github/workflows/submit-linter-suggestions.yml @@ -85,7 +85,7 @@ jobs: -f.diff.strip=1 \ -reporter="github-pr-review" \ -filter-mode="diff_context" \ - -fail-on-error="false" \ + -fail-on-error="true" \ -level="warning" \ < "./pr-linter/linter.diff" env: From e7d6ae7fa04873bcb82c484ce1e1360a1a322c90 Mon Sep 17 00:00:00 2001 From: kkeirstead <85592574+kkeirstead@users.noreply.github.com> Date: Tue, 3 Oct 2023 07:58:30 -0700 Subject: [PATCH 09/44] Update check-learning-path-links.yml --- .github/workflows/check-learning-path-links.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/check-learning-path-links.yml b/.github/workflows/check-learning-path-links.yml index 26cb1b62042..62f02434605 100644 --- a/.github/workflows/check-learning-path-links.yml +++ b/.github/workflows/check-learning-path-links.yml @@ -62,6 +62,7 @@ jobs: mkdir -p ./learning-path-review echo -n "${{ steps.check-links.outputs.modifiedFiles }}" > ./learning-path-review/modifiedFiles echo -n "${{ steps.check-links.outputs.manuallyReview }}" > ./learning-path-review/manuallyReview + echo -n "${{ steps.check-links.outputs.suggestions }}" > ./learning-path-review/suggestions - name: Upload artifacts (Suggestion) uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 From 8fba8a1a9f44d2e5fec208f5a72066fc96b2a9b6 Mon Sep 17 00:00:00 2001 From: kkeirstead <85592574+kkeirstead@users.noreply.github.com> Date: Tue, 3 Oct 2023 08:01:04 -0700 Subject: [PATCH 10/44] Update submit-learning-paths-staleness-check.yml --- .github/workflows/submit-learning-paths-staleness-check.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/submit-learning-paths-staleness-check.yml b/.github/workflows/submit-learning-paths-staleness-check.yml index da3e649acd2..4a74cac4e06 100644 --- a/.github/workflows/submit-learning-paths-staleness-check.yml +++ b/.github/workflows/submit-learning-paths-staleness-check.yml @@ -52,8 +52,10 @@ jobs: run: | modifiedFiles=$(cat ./learning-path-review/modifiedFiles) manuallyReview=$(cat ./learning-path-review/manuallyReview) + suggestions=$(cat ./learning-path-review/suggestions) echo "modifiedFiles=$modifiedFiles" >> $GITHUB_ENV echo "manuallyReview=$manuallyReview" >> $GITHUB_ENV + echo "suggestions=$suggestions" >> $GITHUB_ENV - uses: actions/github-script@v6 name: Submit Comment @@ -62,11 +64,13 @@ jobs: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} MODIFIED_FILES: ${{ env.modifiedFiles }} MANUALLY_REVIEW: ${{ env.manuallyReview }} + SUGGESTIONS: ${{ env.suggestions }} with: script: | modifiedFiles = process.env.MODIFIED_FILES; manuallyReview = process.env.MANUALLY_REVIEW; - comment_body = "### Learning Paths Links Check \n\nChanged files in the Learning Path:\n\n" + modifiedFiles.replaceAll(",", "\n") + "\n\n---------\n\n Files that should be manually reviewed:\n\n" + manuallyReview.replaceAll(",", "\n"); + suggestions = process.env.SUGGESTIONS; + comment_body = "### Learning Paths Links Check \n\nChanged files in the Learning Path:\n\n" + modifiedFiles.replaceAll(",", "\n") + "\n\n---------\n\n Files that should be manually reviewed:\n\n" + manuallyReview.replaceAll(",", "\n") + "\n\n---------\n\n Suggested changes (note: always verify for correctness):\n\n" + suggestions.replaceAll(",", "\n"); github.rest.issues.createComment({ issue_number: context.payload.workflow_run.pull_requests[0].number, owner: context.repo.owner, From c5895d0f6cfb78e738e4976f96b47a794fd90fc7 Mon Sep 17 00:00:00 2001 From: kkeirstead <85592574+kkeirstead@users.noreply.github.com> Date: Tue, 3 Oct 2023 08:11:13 -0700 Subject: [PATCH 11/44] Update submit-learning-paths-staleness-check.yml --- .github/workflows/submit-learning-paths-staleness-check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/submit-learning-paths-staleness-check.yml b/.github/workflows/submit-learning-paths-staleness-check.yml index 4a74cac4e06..a3b9ab5809e 100644 --- a/.github/workflows/submit-learning-paths-staleness-check.yml +++ b/.github/workflows/submit-learning-paths-staleness-check.yml @@ -70,7 +70,7 @@ jobs: modifiedFiles = process.env.MODIFIED_FILES; manuallyReview = process.env.MANUALLY_REVIEW; suggestions = process.env.SUGGESTIONS; - comment_body = "### Learning Paths Links Check \n\nChanged files in the Learning Path:\n\n" + modifiedFiles.replaceAll(",", "\n") + "\n\n---------\n\n Files that should be manually reviewed:\n\n" + manuallyReview.replaceAll(",", "\n") + "\n\n---------\n\n Suggested changes (note: always verify for correctness):\n\n" + suggestions.replaceAll(",", "\n"); + comment_body = "### Learning Paths Staleness Check \n\n #### Impacted Paths:\n\n" + modifiedFiles.replaceAll(",", "\n") + "\n\n---------\n\n #### Manually Review:\n\n" + manuallyReview.replaceAll(",", "\n") + "\n\n---------\n\n #### Suggestions:\n\n" + suggestions.replaceAll(",", "\n"); github.rest.issues.createComment({ issue_number: context.payload.workflow_run.pull_requests[0].number, owner: context.repo.owner, From 7c7530d2163f0f379ea8b8bcd72e378fe68a465a Mon Sep 17 00:00:00 2001 From: kkeirstead <85592574+kkeirstead@users.noreply.github.com> Date: Tue, 3 Oct 2023 10:49:16 -0700 Subject: [PATCH 12/44] Update submit-learning-paths-staleness-check.yml --- .github/workflows/submit-learning-paths-staleness-check.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/submit-learning-paths-staleness-check.yml b/.github/workflows/submit-learning-paths-staleness-check.yml index a3b9ab5809e..c68b42a56e5 100644 --- a/.github/workflows/submit-learning-paths-staleness-check.yml +++ b/.github/workflows/submit-learning-paths-staleness-check.yml @@ -11,7 +11,6 @@ permissions: issues: write pull-requests: write - jobs: submit-learning-paths-staleness-check: if: github.event.workflow_run.conclusion == 'success' From 7c8f459ac91877755a76b8e3897bcda88d2e63c1 Mon Sep 17 00:00:00 2001 From: kkeirstead <85592574+kkeirstead@users.noreply.github.com> Date: Tue, 3 Oct 2023 14:39:44 -0700 Subject: [PATCH 13/44] Update submit-learning-paths-staleness-check.yml --- .../submit-learning-paths-staleness-check.yml | 26 +++++++++++++++---- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/.github/workflows/submit-learning-paths-staleness-check.yml b/.github/workflows/submit-learning-paths-staleness-check.yml index c68b42a56e5..1be083f42ed 100644 --- a/.github/workflows/submit-learning-paths-staleness-check.yml +++ b/.github/workflows/submit-learning-paths-staleness-check.yml @@ -55,9 +55,9 @@ jobs: echo "modifiedFiles=$modifiedFiles" >> $GITHUB_ENV echo "manuallyReview=$manuallyReview" >> $GITHUB_ENV echo "suggestions=$suggestions" >> $GITHUB_ENV - + - uses: actions/github-script@v6 - name: Submit Comment + name: Check For Duplicate Comment if: ${{ env.modifiedFiles != '' }} env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -70,10 +70,26 @@ jobs: manuallyReview = process.env.MANUALLY_REVIEW; suggestions = process.env.SUGGESTIONS; comment_body = "### Learning Paths Staleness Check \n\n #### Impacted Paths:\n\n" + modifiedFiles.replaceAll(",", "\n") + "\n\n---------\n\n #### Manually Review:\n\n" + manuallyReview.replaceAll(",", "\n") + "\n\n---------\n\n #### Suggestions:\n\n" + suggestions.replaceAll(",", "\n"); - github.rest.issues.createComment({ + + const comments = github.rest.issues.listComments({ issue_number: context.payload.workflow_run.pull_requests[0].number, owner: context.repo.owner, - repo: context.repo.repo, - body: comment_body + repo: context.repo.repo }) + var commentExists = false; + for (const comment of comments) { + if (comment.body == comment_body) { + commentExists = true; + } + } + + if (!commentExists) + { + github.rest.issues.createComment({ + issue_number: context.payload.workflow_run.pull_requests[0].number, + owner: context.repo.owner, + repo: context.repo.repo, + body: comment_body + }) + } From bf6c3538a126d56270606a15b2b512034923c75f Mon Sep 17 00:00:00 2001 From: kkeirstead <85592574+kkeirstead@users.noreply.github.com> Date: Tue, 3 Oct 2023 14:44:35 -0700 Subject: [PATCH 14/44] Update submit-learning-paths-staleness-check.yml --- .github/workflows/submit-learning-paths-staleness-check.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/submit-learning-paths-staleness-check.yml b/.github/workflows/submit-learning-paths-staleness-check.yml index 1be083f42ed..44d554788ff 100644 --- a/.github/workflows/submit-learning-paths-staleness-check.yml +++ b/.github/workflows/submit-learning-paths-staleness-check.yml @@ -71,12 +71,15 @@ jobs: suggestions = process.env.SUGGESTIONS; comment_body = "### Learning Paths Staleness Check \n\n #### Impacted Paths:\n\n" + modifiedFiles.replaceAll(",", "\n") + "\n\n---------\n\n #### Manually Review:\n\n" + manuallyReview.replaceAll(",", "\n") + "\n\n---------\n\n #### Suggestions:\n\n" + suggestions.replaceAll(",", "\n"); - const comments = github.rest.issues.listComments({ + const comments = await github.rest.issues.listComments({ issue_number: context.payload.workflow_run.pull_requests[0].number, owner: context.repo.owner, repo: context.repo.repo }) + console.log(comments); + console.log(typeof comments); + var commentExists = false; for (const comment of comments) { if (comment.body == comment_body) { From 7d7aa674a852645d9480443812677ed290eccbe0 Mon Sep 17 00:00:00 2001 From: kkeirstead <85592574+kkeirstead@users.noreply.github.com> Date: Tue, 3 Oct 2023 14:48:40 -0700 Subject: [PATCH 15/44] Update submit-learning-paths-staleness-check.yml --- .github/workflows/submit-learning-paths-staleness-check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/submit-learning-paths-staleness-check.yml b/.github/workflows/submit-learning-paths-staleness-check.yml index 44d554788ff..4c5bff6c110 100644 --- a/.github/workflows/submit-learning-paths-staleness-check.yml +++ b/.github/workflows/submit-learning-paths-staleness-check.yml @@ -81,7 +81,7 @@ jobs: console.log(typeof comments); var commentExists = false; - for (const comment of comments) { + for (const comment of comments[data]) { if (comment.body == comment_body) { commentExists = true; } From 8bb85e22b720c3a7a579b5ea0c2deb4ada4beab3 Mon Sep 17 00:00:00 2001 From: kkeirstead <85592574+kkeirstead@users.noreply.github.com> Date: Tue, 3 Oct 2023 14:50:43 -0700 Subject: [PATCH 16/44] Update submit-learning-paths-staleness-check.yml --- .github/workflows/submit-learning-paths-staleness-check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/submit-learning-paths-staleness-check.yml b/.github/workflows/submit-learning-paths-staleness-check.yml index 4c5bff6c110..cf6c37689d7 100644 --- a/.github/workflows/submit-learning-paths-staleness-check.yml +++ b/.github/workflows/submit-learning-paths-staleness-check.yml @@ -81,7 +81,7 @@ jobs: console.log(typeof comments); var commentExists = false; - for (const comment of comments[data]) { + for (const comment of comments.data) { if (comment.body == comment_body) { commentExists = true; } From 944ea6d0f79020cff0f859fbed01d52fa4cae39c Mon Sep 17 00:00:00 2001 From: kkeirstead <85592574+kkeirstead@users.noreply.github.com> Date: Tue, 3 Oct 2023 14:54:57 -0700 Subject: [PATCH 17/44] Update submit-learning-paths-staleness-check.yml --- .../workflows/submit-learning-paths-staleness-check.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/submit-learning-paths-staleness-check.yml b/.github/workflows/submit-learning-paths-staleness-check.yml index cf6c37689d7..53a16b9deed 100644 --- a/.github/workflows/submit-learning-paths-staleness-check.yml +++ b/.github/workflows/submit-learning-paths-staleness-check.yml @@ -77,11 +77,14 @@ jobs: repo: context.repo.repo }) - console.log(comments); - console.log(typeof comments); - var commentExists = false; + + console.log("Actual comment body:"); + console.log(comment_body); + console.log(""); + for (const comment of comments.data) { + console.log(comment.body); if (comment.body == comment_body) { commentExists = true; } From a960d516ac2a538f3e54df0f38a8a4ca34e07c17 Mon Sep 17 00:00:00 2001 From: kkeirstead <85592574+kkeirstead@users.noreply.github.com> Date: Tue, 3 Oct 2023 15:02:19 -0700 Subject: [PATCH 18/44] Update submit-learning-paths-staleness-check.yml --- .../workflows/submit-learning-paths-staleness-check.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/submit-learning-paths-staleness-check.yml b/.github/workflows/submit-learning-paths-staleness-check.yml index 53a16b9deed..832e51bb096 100644 --- a/.github/workflows/submit-learning-paths-staleness-check.yml +++ b/.github/workflows/submit-learning-paths-staleness-check.yml @@ -82,11 +82,16 @@ jobs: console.log("Actual comment body:"); console.log(comment_body); console.log(""); + + const new_comment_stripped = comment_body.replaceAll(/\s/g,'') for (const comment of comments.data) { console.log(comment.body); - if (comment.body == comment_body) { + const old_comment_stripped = comment.body.replaceAll(/\s/g,'') + + if (old_comment_stripped.equals(new_comment_stripped)) { commentExists = true; + console.log("Match!"); } } From 506152d5a673ad9a70d4a36b41621a8160ae0351 Mon Sep 17 00:00:00 2001 From: kkeirstead <85592574+kkeirstead@users.noreply.github.com> Date: Tue, 3 Oct 2023 15:04:27 -0700 Subject: [PATCH 19/44] Update submit-learning-paths-staleness-check.yml --- .github/workflows/submit-learning-paths-staleness-check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/submit-learning-paths-staleness-check.yml b/.github/workflows/submit-learning-paths-staleness-check.yml index 832e51bb096..fcf0bf10a42 100644 --- a/.github/workflows/submit-learning-paths-staleness-check.yml +++ b/.github/workflows/submit-learning-paths-staleness-check.yml @@ -89,7 +89,7 @@ jobs: console.log(comment.body); const old_comment_stripped = comment.body.replaceAll(/\s/g,'') - if (old_comment_stripped.equals(new_comment_stripped)) { + if (old_comment_stripped === new_comment_stripped) { commentExists = true; console.log("Match!"); } From 84604addca2989056d86912a5d66cacf0f8f4e6b Mon Sep 17 00:00:00 2001 From: kkeirstead <85592574+kkeirstead@users.noreply.github.com> Date: Wed, 4 Oct 2023 11:49:25 -0700 Subject: [PATCH 20/44] Update submit-linter-suggestions.yml --- .github/workflows/submit-linter-suggestions.yml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.github/workflows/submit-linter-suggestions.yml b/.github/workflows/submit-linter-suggestions.yml index 4b52001ac1f..bd2affb28af 100644 --- a/.github/workflows/submit-linter-suggestions.yml +++ b/.github/workflows/submit-linter-suggestions.yml @@ -2,7 +2,7 @@ name: 'Submit linter suggestions' on: workflow_run: - workflows: ["C# linting", "Add Markdown Feedback", "Check Learning Path Links"] + workflows: ["C# linting", "Add Markdown Feedback"] types: - completed @@ -46,12 +46,6 @@ jobs: echo 'reporter_name=Add Markdown Feedback' >> $GITHUB_ENV echo 'workflow_name=add-markdown-feedback.yml' >> $GITHUB_ENV - - name: Set Learning Path File Checks Env Vars - if: ${{ github.event.workflow_run.name == 'Check Learning Path Links' }} - run: | - echo 'reporter_name=Learning Path File Checks' >> $GITHUB_ENV - echo 'workflow_name=check-learning-path-links.yml' >> $GITHUB_ENV - # Download the artifact from the workflow that kicked off this one. # The default artifact download action doesn't support cross-workflow # artifacts, so use a 3rd party one. From c360b099022a49552d84d2b69fdafa7ffeac0634 Mon Sep 17 00:00:00 2001 From: kkeirstead <85592574+kkeirstead@users.noreply.github.com> Date: Wed, 4 Oct 2023 11:50:13 -0700 Subject: [PATCH 21/44] Update check-learning-path-links.yml --- .github/workflows/check-learning-path-links.yml | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/.github/workflows/check-learning-path-links.yml b/.github/workflows/check-learning-path-links.yml index 62f02434605..6768742549a 100644 --- a/.github/workflows/check-learning-path-links.yml +++ b/.github/workflows/check-learning-path-links.yml @@ -48,13 +48,6 @@ jobs: repoURLToSearch: 'https://github.com/dotnet/dotnet-monitor' learningPathsDirectory: 'documentation/learningPath' paths: ${{ env.updated_files }} - - - name: Generate artifacts (Suggestion) - working-directory: ./merge - run: | - mkdir -p ./pr - cp "$GITHUB_EVENT_PATH" ./pr/pr-event.json - git diff > ./pr/linter.diff - name: Generate artifacts (Comment) working-directory: ./merge @@ -64,12 +57,6 @@ jobs: echo -n "${{ steps.check-links.outputs.manuallyReview }}" > ./learning-path-review/manuallyReview echo -n "${{ steps.check-links.outputs.suggestions }}" > ./learning-path-review/suggestions - - name: Upload artifacts (Suggestion) - uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 - with: - name: pr-linter - path: merge/pr/ - - name: Upload artifacts (Comment) uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 with: From 62d84cbad46873db2a759ccc33df8312fa115714 Mon Sep 17 00:00:00 2001 From: kkeirstead <85592574+kkeirstead@users.noreply.github.com> Date: Wed, 4 Oct 2023 11:52:38 -0700 Subject: [PATCH 22/44] Update check-learning-path-links.yml --- .github/workflows/check-learning-path-links.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/check-learning-path-links.yml b/.github/workflows/check-learning-path-links.yml index 6768742549a..611aa1be60e 100644 --- a/.github/workflows/check-learning-path-links.yml +++ b/.github/workflows/check-learning-path-links.yml @@ -48,6 +48,7 @@ jobs: repoURLToSearch: 'https://github.com/dotnet/dotnet-monitor' learningPathsDirectory: 'documentation/learningPath' paths: ${{ env.updated_files }} + sourceDirectoryName: 'src' - name: Generate artifacts (Comment) working-directory: ./merge From 82c54b407972511aadec6431d7a1dd5615fe0792 Mon Sep 17 00:00:00 2001 From: kkeirstead <85592574+kkeirstead@users.noreply.github.com> Date: Wed, 4 Oct 2023 12:35:33 -0700 Subject: [PATCH 23/44] Update configuration.md --- documentation/learningPath/configuration.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/learningPath/configuration.md b/documentation/learningPath/configuration.md index 53242df9928..4b96afd97f8 100644 --- a/documentation/learningPath/configuration.md +++ b/documentation/learningPath/configuration.md @@ -8,7 +8,7 @@ `dotnet-monitor` accepts configuration from several different sources, and must [combine these sources for the host builder](https://github.com/dotnet/dotnet-monitor/blob/ba8c36235943562581b666e74ef07954313eda56/src/Tools/dotnet-monitor/HostBuilder/HostBuilderHelper.cs#L46). Configuration sources are added in the order of lowest to highest precedence - meaning that if there is a conflict between a property in two configuration sources, the property found in the latter configuration source will be used. -To see the merged configuration, the user can run the `config show` command (see [here](https://github.com/dotnet/dotnet-monitor/blob/ba8c36235943562581b666e74ef07954313eda56/src/Tools/dotnet-monitor/Program.cs#L69) and [here](https://github.com/dotnet/dotnet-monitor/blob/ba8c36235943562581b666e74ef07954313eda56/src/Tools/dotnet-monitor/Commands/ConfigShowCommandHandler.cs)); the `--show-sources` flag can be used to reveal which configuration source is responsible for each property. The `config show` command's output is [written out as JSON](https://github.com/dotnet/dotnet-monitor/blob/ba8c36235943562581b666e74ef07954313eda56/src/Tools/dotnet-monitor/ConfigurationJsonWriter.cs); this section must be manually updated whenever new options are added (or existing options are changed). +To see the merged configuration, the user can run the `config show` command (see [here](https://github.com/dotnet/dotnet-monitor/blob/main/src/Tools/dotnet-monitor/Program.cs#L68) and [here](https://github.com/dotnet/dotnet-monitor/blob/main/src/Tools/dotnet-monitor/Commands/ConfigShowCommandHandler.cs)); the `--show-sources` flag can be used to reveal which configuration source is responsible for each property. The `config show` command's output is [written out as JSON](https://github.com/dotnet/dotnet-monitor/blob/ba8c36235943562581b666e74ef07954313eda56/src/Tools/dotnet-monitor/ConfigurationJsonWriter.cs); this section must be manually updated whenever new options are added (or existing options are changed). Once configuration has been merged, any singletons that have been added to the `IServiceCollection` (see [here](https://github.com/dotnet/dotnet-monitor/blob/ba8c36235943562581b666e74ef07954313eda56/src/Tools/dotnet-monitor/ServiceCollectionExtensions.cs) and [here](https://github.com/dotnet/dotnet-monitor/blob/ba8c36235943562581b666e74ef07954313eda56/src/Tools/dotnet-monitor/Commands/CollectCommandHandler.cs#L80)), such as `IConfigureOptions`, `IPostConfigureOptions`, and `IValidateOptions`, are called when an object of that type is first used, **not on startup**. This step is often used to incorporate defaults for properties that were not explicitly set by configuration, or to validate that options were set correctly. From 0a1a0f7b826b37a6ff52b6a6770c67e9d7d1c49b Mon Sep 17 00:00:00 2001 From: kkeirstead <85592574+kkeirstead@users.noreply.github.com> Date: Wed, 4 Oct 2023 12:43:55 -0700 Subject: [PATCH 24/44] Update collectionrules.md --- documentation/learningPath/collectionrules.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/learningPath/collectionrules.md b/documentation/learningPath/collectionrules.md index dc7c0f8becb..b6dd24da27c 100644 --- a/documentation/learningPath/collectionrules.md +++ b/documentation/learningPath/collectionrules.md @@ -53,7 +53,7 @@ Filters can optionally be applied to a collection rule to choose which processes ### Limits -Limits can optionally be applied to a collection rule to constrain the lifetime of the rule and how often its actions can be run before being throttled. Options for limits can be found [here](https://github.com/dotnet/dotnet-monitor/blob/main/src/Tools/dotnet-monitor/CollectionRules/Options/CollectionRuleLimitsOptions.cs). When provided (or when using default values), limits are evaluated in the collection rule pipeline while running. `RuleDuration` is used to [create a token](https://github.com/dotnet/dotnet-monitor/blob/main/src/Tools/dotnet-monitor/CollectionRules/CollectionRulePipeline.cs#L79) that shuts down the pipeline. `ActionCountSlidingWindowDuration` does not rely on setting cancellation tokens; rather, the number of executions within the sliding window are checked on-demand [here](https://github.com/dotnet/dotnet-monitor/blob/main/src/Microsoft.Diagnostics.Monitoring.WebApi/CollectionRulePipelineState.cs#L212), and `ActionCount` is referenced to determine whether the rule needs to [terminate](https://github.com/dotnet/dotnet-monitor/blob/main/src/Microsoft.Diagnostics.Monitoring.WebApi/CollectionRulePipelineState.cs#L195) or [throttle](https://github.com/dotnet/dotnet-monitor/blob/main/src/Microsoft.Diagnostics.Monitoring.WebApi/CollectionRulePipelineState.cs#L235). +Limits can optionally be applied to a collection rule to constrain the lifetime of the rule and how often its actions can be run before being throttled. Options for limits can be found [here](https://github.com/dotnet/dotnet-monitor/blob/main/src/Tools/dotnet-monitor/CollectionRules/Options/CollectionRuleLimitsOptions.cs). When provided (or when using default values), limits are evaluated in the collection rule pipeline while running. `RuleDuration` is used to [create a token](https://github.com/dotnet/dotnet-monitor/blob/main/src/Tools/dotnet-monitor/CollectionRules/CollectionRulePipeline.cs#L79) that shuts down the pipeline. `ActionCountSlidingWindowDuration` does not rely on setting cancellation tokens; rather, the number of executions within the sliding window are checked on-demand [here](https://github.com/dotnet/dotnet-monitor/blob/main/src/Microsoft.Diagnostics.Monitoring.WebApi/CollectionRulePipelineState.cs#L212), and `ActionCount` is referenced to determine whether the rule needs to [terminate](https://github.com/dotnet/dotnet-monitor/blob/main/src/Microsoft.Diagnostics.Monitoring.WebApi/CollectionRulePipelineState.cs#L195) or [throttle](https://github.com/dotnet/dotnet-monitor/blob/main/src/Microsoft.Diagnostics.Monitoring.WebApi/CollectionRulePipelineState.cs#L234). ## Miscellaneous From b287d1bdba4b2fbf1dd2ac17e3fbd0881629c24d Mon Sep 17 00:00:00 2001 From: kkeirstead <85592574+kkeirstead@users.noreply.github.com> Date: Wed, 4 Oct 2023 13:48:35 -0700 Subject: [PATCH 25/44] Update testing.md --- documentation/learningPath/testing.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/documentation/learningPath/testing.md b/documentation/learningPath/testing.md index 38a36633348..24153c55a7d 100644 --- a/documentation/learningPath/testing.md +++ b/documentation/learningPath/testing.md @@ -31,9 +31,9 @@ Functional tests are composed of 3 main parts: 1. An instance of an application that is being monitored (from the UnitTestApp assembly) * [ScenarioRunner](../../src/Tests/Microsoft.Diagnostics.Monitoring.Tool.FunctionalTests/Runners/ScenarioRunner.cs) is typically used to orchestrate test runs. The class will spawn both an instance of dotnet-monitor and an instance of test application. The app and the test communicate via stdio. The test communicates with dotnet-monitor via its Api surface. -* The dotnet-monitor Api surface can be accessed through the [ApiClient](../../src/Tests/Microsoft.Diagnostics.Monitoring.Tool.FunctionalTests/HttpApi/ApiClient.cs). +* The dotnet-monitor Api surface can be accessed through the [ApiClient](https://github.com/dotnet/dotnet-monitor/blob/main/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.FunctionalTests/HttpApi/ApiClient.cs). * New scenarios can be added [here](../../src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/Scenarios/). -* The [AsyncWaitScenario](../../src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/Scenarios/AsyncWaitScenario.cs) is sufficient for most tests. +* The [AsyncWaitScenario](https://github.com/dotnet/dotnet-monitor/blob/main/src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/Scenarios/AsyncWaitScenario.cs) is sufficient for most tests. * Coordination of the scenario and the test is done via message passing (json over stdio) between the test and the app. To send messages to the app from the test, [AppRunner](../../src/Tests/Microsoft.Diagnostics.Monitoring.TestCommon/Runners/AppRunner.cs)'s `SendCommandAsync` is used. In the scenario definition, [ScenarioHelpers](../../src/Tests/Microsoft.Diagnostics.Monitoring.UnitTestApp/ScenarioHelpers.cs)'s `WaitForCommandAsync` is used. This can be used to synchronize various points of the test application with the execution of the dotnet-monitor Api from the test itself. ## Native/Profiler Tests From 0d1afa3e9902f4aaeb5ab81d1e5376355f48cd1f Mon Sep 17 00:00:00 2001 From: kkeirstead <85592574+kkeirstead@users.noreply.github.com> Date: Fri, 6 Oct 2023 08:22:14 -0700 Subject: [PATCH 26/44] Update check-learning-path-links.yml --- .github/workflows/check-learning-path-links.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check-learning-path-links.yml b/.github/workflows/check-learning-path-links.yml index 611aa1be60e..6a8f8a7dc72 100644 --- a/.github/workflows/check-learning-path-links.yml +++ b/.github/workflows/check-learning-path-links.yml @@ -47,7 +47,7 @@ jobs: with: repoURLToSearch: 'https://github.com/dotnet/dotnet-monitor' learningPathsDirectory: 'documentation/learningPath' - paths: ${{ env.updated_files }} + changedFilePaths: ${{ env.updated_files }} sourceDirectoryName: 'src' - name: Generate artifacts (Comment) From 9394604c5bc40fbfc67705705fad46f60b9a9a5e Mon Sep 17 00:00:00 2001 From: kkeirstead <85592574+kkeirstead@users.noreply.github.com> Date: Fri, 6 Oct 2023 11:58:29 -0700 Subject: [PATCH 27/44] Update CollectionRulePipelineState.cs --- .../CollectionRulePipelineState.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Microsoft.Diagnostics.Monitoring.WebApi/CollectionRulePipelineState.cs b/src/Microsoft.Diagnostics.Monitoring.WebApi/CollectionRulePipelineState.cs index 6eea50bc2b0..ead12b79546 100644 --- a/src/Microsoft.Diagnostics.Monitoring.WebApi/CollectionRulePipelineState.cs +++ b/src/Microsoft.Diagnostics.Monitoring.WebApi/CollectionRulePipelineState.cs @@ -231,6 +231,7 @@ private static void DequeueOldTimestamps(Queue executionTimestamps, Ti } } + # LP 5d8697c3-3ded-43df-a349-4b21207010a6 private static bool CheckForThrottling(int actionCountLimit, TimeSpan? actionCountSWD, int executionTimestampsCount) { return actionCountSWD.HasValue && actionCountLimit <= executionTimestampsCount; From 68ba9e946b0d0d572169ca52678812a3895d2e90 Mon Sep 17 00:00:00 2001 From: kkeirstead <85592574+kkeirstead@users.noreply.github.com> Date: Fri, 6 Oct 2023 12:10:16 -0700 Subject: [PATCH 28/44] Update collectionrules.md --- documentation/learningPath/collectionrules.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/learningPath/collectionrules.md b/documentation/learningPath/collectionrules.md index b6dd24da27c..414eff16a1b 100644 --- a/documentation/learningPath/collectionrules.md +++ b/documentation/learningPath/collectionrules.md @@ -53,7 +53,7 @@ Filters can optionally be applied to a collection rule to choose which processes ### Limits -Limits can optionally be applied to a collection rule to constrain the lifetime of the rule and how often its actions can be run before being throttled. Options for limits can be found [here](https://github.com/dotnet/dotnet-monitor/blob/main/src/Tools/dotnet-monitor/CollectionRules/Options/CollectionRuleLimitsOptions.cs). When provided (or when using default values), limits are evaluated in the collection rule pipeline while running. `RuleDuration` is used to [create a token](https://github.com/dotnet/dotnet-monitor/blob/main/src/Tools/dotnet-monitor/CollectionRules/CollectionRulePipeline.cs#L79) that shuts down the pipeline. `ActionCountSlidingWindowDuration` does not rely on setting cancellation tokens; rather, the number of executions within the sliding window are checked on-demand [here](https://github.com/dotnet/dotnet-monitor/blob/main/src/Microsoft.Diagnostics.Monitoring.WebApi/CollectionRulePipelineState.cs#L212), and `ActionCount` is referenced to determine whether the rule needs to [terminate](https://github.com/dotnet/dotnet-monitor/blob/main/src/Microsoft.Diagnostics.Monitoring.WebApi/CollectionRulePipelineState.cs#L195) or [throttle](https://github.com/dotnet/dotnet-monitor/blob/main/src/Microsoft.Diagnostics.Monitoring.WebApi/CollectionRulePipelineState.cs#L234). +Limits can optionally be applied to a collection rule to constrain the lifetime of the rule and how often its actions can be run before being throttled. Options for limits can be found [here](https://github.com/dotnet/dotnet-monitor/blob/main/src/Tools/dotnet-monitor/CollectionRules/Options/CollectionRuleLimitsOptions.cs). When provided (or when using default values), limits are evaluated in the collection rule pipeline while running. `RuleDuration` is used to [create a token](https://github.com/dotnet/dotnet-monitor/blob/main/src/Tools/dotnet-monitor/CollectionRules/CollectionRulePipeline.cs#L79) that shuts down the pipeline. `ActionCountSlidingWindowDuration` does not rely on setting cancellation tokens; rather, the number of executions within the sliding window are checked on-demand [here](https://github.com/dotnet/dotnet-monitor/blob/main/src/Microsoft.Diagnostics.Monitoring.WebApi/CollectionRulePipelineState.cs#L212), and `ActionCount` is referenced to determine whether the rule needs to [terminate](https://github.com/dotnet/dotnet-monitor/blob/main/src/Microsoft.Diagnostics.Monitoring.WebApi/CollectionRulePipelineState.cs#L195) or [throttle5d8697c3-3ded-43df-a349-4b21207010a6](https://github.com/dotnet/dotnet-monitor/blob/main/src/Microsoft.Diagnostics.Monitoring.WebApi/CollectionRulePipelineState.cs#L234). ## Miscellaneous From 022fe98f84ef8192099ddb0bcf81128991bf072f Mon Sep 17 00:00:00 2001 From: kkeirstead <85592574+kkeirstead@users.noreply.github.com> Date: Fri, 6 Oct 2023 12:11:04 -0700 Subject: [PATCH 29/44] Create check-learning-path-links-anchor.yml --- .github/workflows/check-learning-path-links-anchor.yml | 1 + 1 file changed, 1 insertion(+) create mode 100644 .github/workflows/check-learning-path-links-anchor.yml diff --git a/.github/workflows/check-learning-path-links-anchor.yml b/.github/workflows/check-learning-path-links-anchor.yml new file mode 100644 index 00000000000..8b137891791 --- /dev/null +++ b/.github/workflows/check-learning-path-links-anchor.yml @@ -0,0 +1 @@ + From bc9c983d0ef11e914ea57f74499ade3a76d83561 Mon Sep 17 00:00:00 2001 From: kkeirstead <85592574+kkeirstead@users.noreply.github.com> Date: Fri, 6 Oct 2023 12:27:26 -0700 Subject: [PATCH 30/44] Update check-learning-path-links-anchor.yml --- .../check-learning-path-links-anchor.yml | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/.github/workflows/check-learning-path-links-anchor.yml b/.github/workflows/check-learning-path-links-anchor.yml index 8b137891791..2120c4558b9 100644 --- a/.github/workflows/check-learning-path-links-anchor.yml +++ b/.github/workflows/check-learning-path-links-anchor.yml @@ -1 +1,49 @@ +name: 'Check Learning Path Links' +on: + pull_request: + branches: ['main'] +permissions: + pull-requests: read + +jobs: + check-learning-path-links-anchor: + if: contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.pull_request.author_association) + name: 'Check Learning Path Links Anchor' + runs-on: ubuntu-latest + + steps: + - name: Checkout merge + uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac + with: + persist-credentials: false + path: merge + + - name: Checkout head + uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac + with: + persist-credentials: false + ref: main + path: head + + - name: Get base commit for the PR + working-directory: ./merge + run: | + git fetch origin "$GITHUB_BASE_REF" + base_sha=$(git rev-parse "origin/$GITHUB_BASE_REF") + echo "base_sha=$base_sha" >> $GITHUB_ENV + echo "Merging ${GITHUB_SHA} into ${GITHUB_BASE_REF}" + + - name: Get learning path files from head + working-directory: ./head/documentation/learningPath + run: | + learning_path_files=$({ grep "**.md$" }) + echo "Files to validate: '${learning_path_files}'" + echo "learning_path_files=$(echo ${learning_path_files})" >> $GITHUB_ENV + + for file in learning_path_files; do + if grep -qE '^[{]?[0-9a-fA-F]{8}-([0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}[}]?$' "$file"; then + echo "Found unique identifier in $file" + else + echo "No unique identifier found in $file" + fi From ad099064a8ae028a76c64e09b81bec821cbebb65 Mon Sep 17 00:00:00 2001 From: kkeirstead <85592574+kkeirstead@users.noreply.github.com> Date: Fri, 6 Oct 2023 12:29:07 -0700 Subject: [PATCH 31/44] Update TimeProvider.cs --- src/Tools/dotnet-monitor/TimeProvider.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Tools/dotnet-monitor/TimeProvider.cs b/src/Tools/dotnet-monitor/TimeProvider.cs index 5942ef111fd..f6b4b6ffc86 100644 --- a/src/Tools/dotnet-monitor/TimeProvider.cs +++ b/src/Tools/dotnet-monitor/TimeProvider.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. #if !NET8_0_OR_GREATER + namespace System { // The TimeProvider class is new to .NET 8 and not available in down-level versions. From 0b68fb82a407450b19cdab56e60a5e6d1e26eecf Mon Sep 17 00:00:00 2001 From: kkeirstead <85592574+kkeirstead@users.noreply.github.com> Date: Fri, 6 Oct 2023 12:35:35 -0700 Subject: [PATCH 32/44] Update TimeProvider.cs --- src/Tools/dotnet-monitor/TimeProvider.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Tools/dotnet-monitor/TimeProvider.cs b/src/Tools/dotnet-monitor/TimeProvider.cs index f6b4b6ffc86..f3586ff8b87 100644 --- a/src/Tools/dotnet-monitor/TimeProvider.cs +++ b/src/Tools/dotnet-monitor/TimeProvider.cs @@ -1,6 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. + #if !NET8_0_OR_GREATER namespace System From 7d945db3b15ee17c6e91b314323c0183cd77d38f Mon Sep 17 00:00:00 2001 From: kkeirstead <85592574+kkeirstead@users.noreply.github.com> Date: Fri, 6 Oct 2023 13:30:32 -0700 Subject: [PATCH 33/44] Update TimeProvider.cs --- src/Tools/dotnet-monitor/TimeProvider.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Tools/dotnet-monitor/TimeProvider.cs b/src/Tools/dotnet-monitor/TimeProvider.cs index f3586ff8b87..293a7082e84 100644 --- a/src/Tools/dotnet-monitor/TimeProvider.cs +++ b/src/Tools/dotnet-monitor/TimeProvider.cs @@ -3,7 +3,6 @@ #if !NET8_0_OR_GREATER - namespace System { // The TimeProvider class is new to .NET 8 and not available in down-level versions. From 190f76f5d38704261e8c665e5296d552ad531176 Mon Sep 17 00:00:00 2001 From: kkeirstead <85592574+kkeirstead@users.noreply.github.com> Date: Fri, 6 Oct 2023 13:32:30 -0700 Subject: [PATCH 34/44] Update TimeProvider.cs --- src/Tools/dotnet-monitor/TimeProvider.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Tools/dotnet-monitor/TimeProvider.cs b/src/Tools/dotnet-monitor/TimeProvider.cs index 293a7082e84..5942ef111fd 100644 --- a/src/Tools/dotnet-monitor/TimeProvider.cs +++ b/src/Tools/dotnet-monitor/TimeProvider.cs @@ -1,7 +1,6 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. - #if !NET8_0_OR_GREATER namespace System { From ca4873a40826cf44fccdea2c7412421b350d4187 Mon Sep 17 00:00:00 2001 From: kkeirstead <85592574+kkeirstead@users.noreply.github.com> Date: Fri, 6 Oct 2023 13:35:16 -0700 Subject: [PATCH 35/44] Update TimeProvider.cs --- src/Tools/dotnet-monitor/TimeProvider.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Tools/dotnet-monitor/TimeProvider.cs b/src/Tools/dotnet-monitor/TimeProvider.cs index 5942ef111fd..f6b4b6ffc86 100644 --- a/src/Tools/dotnet-monitor/TimeProvider.cs +++ b/src/Tools/dotnet-monitor/TimeProvider.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. #if !NET8_0_OR_GREATER + namespace System { // The TimeProvider class is new to .NET 8 and not available in down-level versions. From 5e0daaccbf69ca93654c56e90bfb3bfc88887866 Mon Sep 17 00:00:00 2001 From: kkeirstead <85592574+kkeirstead@users.noreply.github.com> Date: Fri, 6 Oct 2023 13:40:40 -0700 Subject: [PATCH 36/44] Update TimeProvider.cs --- src/Tools/dotnet-monitor/TimeProvider.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Tools/dotnet-monitor/TimeProvider.cs b/src/Tools/dotnet-monitor/TimeProvider.cs index f6b4b6ffc86..0fe58674c4b 100644 --- a/src/Tools/dotnet-monitor/TimeProvider.cs +++ b/src/Tools/dotnet-monitor/TimeProvider.cs @@ -1,4 +1,5 @@ -// Licensed to the .NET Foundation under one or more agreements. + +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. #if !NET8_0_OR_GREATER From de60d6b62f57bea90b53734d11349bc57db916ac Mon Sep 17 00:00:00 2001 From: kkeirstead <85592574+kkeirstead@users.noreply.github.com> Date: Fri, 6 Oct 2023 13:46:24 -0700 Subject: [PATCH 37/44] Update TimeProvider.cs --- src/Tools/dotnet-monitor/TimeProvider.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Tools/dotnet-monitor/TimeProvider.cs b/src/Tools/dotnet-monitor/TimeProvider.cs index 0fe58674c4b..b0d367a039a 100644 --- a/src/Tools/dotnet-monitor/TimeProvider.cs +++ b/src/Tools/dotnet-monitor/TimeProvider.cs @@ -1,4 +1,3 @@ - // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. From 4ec8c9c8bfd87e5992d7d874141ad4cd5ecfd5e9 Mon Sep 17 00:00:00 2001 From: kkeirstead <85592574+kkeirstead@users.noreply.github.com> Date: Fri, 6 Oct 2023 13:51:50 -0700 Subject: [PATCH 38/44] Update TimeProvider.cs --- src/Tools/dotnet-monitor/TimeProvider.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Tools/dotnet-monitor/TimeProvider.cs b/src/Tools/dotnet-monitor/TimeProvider.cs index b0d367a039a..850ea8e6b49 100644 --- a/src/Tools/dotnet-monitor/TimeProvider.cs +++ b/src/Tools/dotnet-monitor/TimeProvider.cs @@ -1,6 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. + #if !NET8_0_OR_GREATER namespace System From 3b5d95573b212ddf81a3434de8e87096fd9588d9 Mon Sep 17 00:00:00 2001 From: kkeirstead <85592574+kkeirstead@users.noreply.github.com> Date: Fri, 6 Oct 2023 13:54:45 -0700 Subject: [PATCH 39/44] Update TimeProvider.cs --- src/Tools/dotnet-monitor/TimeProvider.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Tools/dotnet-monitor/TimeProvider.cs b/src/Tools/dotnet-monitor/TimeProvider.cs index 850ea8e6b49..a89fbaa7c5e 100644 --- a/src/Tools/dotnet-monitor/TimeProvider.cs +++ b/src/Tools/dotnet-monitor/TimeProvider.cs @@ -18,7 +18,6 @@ public virtual DateTimeOffset GetUtcNow() } public static TimeProvider System { get; } = new SystemTimeProvider(); - private sealed class SystemTimeProvider : TimeProvider { } } } From 0d697cd23f1c6efd8294fb852f1ffa574a886bd8 Mon Sep 17 00:00:00 2001 From: kkeirstead <85592574+kkeirstead@users.noreply.github.com> Date: Fri, 6 Oct 2023 13:57:38 -0700 Subject: [PATCH 40/44] Update TimeProvider.cs --- src/Tools/dotnet-monitor/TimeProvider.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Tools/dotnet-monitor/TimeProvider.cs b/src/Tools/dotnet-monitor/TimeProvider.cs index a89fbaa7c5e..a31bc91d242 100644 --- a/src/Tools/dotnet-monitor/TimeProvider.cs +++ b/src/Tools/dotnet-monitor/TimeProvider.cs @@ -3,7 +3,6 @@ #if !NET8_0_OR_GREATER - namespace System { // The TimeProvider class is new to .NET 8 and not available in down-level versions. From bdbac809dff079d40b47553bd19aaae1f3de4042 Mon Sep 17 00:00:00 2001 From: kkeirstead <85592574+kkeirstead@users.noreply.github.com> Date: Fri, 6 Oct 2023 14:11:40 -0700 Subject: [PATCH 41/44] Update TimeProvider.cs --- src/Tools/dotnet-monitor/TimeProvider.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Tools/dotnet-monitor/TimeProvider.cs b/src/Tools/dotnet-monitor/TimeProvider.cs index a31bc91d242..95fda5f0614 100644 --- a/src/Tools/dotnet-monitor/TimeProvider.cs +++ b/src/Tools/dotnet-monitor/TimeProvider.cs @@ -1,7 +1,6 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. - #if !NET8_0_OR_GREATER namespace System { From 3645812b4fc54c429e740eda06fd76f1c4bc3478 Mon Sep 17 00:00:00 2001 From: kkeirstead <85592574+kkeirstead@users.noreply.github.com> Date: Fri, 6 Oct 2023 14:16:33 -0700 Subject: [PATCH 42/44] Update TimeProvider.cs --- src/Tools/dotnet-monitor/TimeProvider.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Tools/dotnet-monitor/TimeProvider.cs b/src/Tools/dotnet-monitor/TimeProvider.cs index 95fda5f0614..14d87863514 100644 --- a/src/Tools/dotnet-monitor/TimeProvider.cs +++ b/src/Tools/dotnet-monitor/TimeProvider.cs @@ -19,4 +19,5 @@ public virtual DateTimeOffset GetUtcNow() private sealed class SystemTimeProvider : TimeProvider { } } } + #endif From c3c6d4ded63de878c9af80bf54b8057a32b422ac Mon Sep 17 00:00:00 2001 From: kkeirstead <85592574+kkeirstead@users.noreply.github.com> Date: Fri, 6 Oct 2023 14:31:09 -0700 Subject: [PATCH 43/44] Update CollectionRulePipelineState.cs --- .../CollectionRulePipelineState.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Microsoft.Diagnostics.Monitoring.WebApi/CollectionRulePipelineState.cs b/src/Microsoft.Diagnostics.Monitoring.WebApi/CollectionRulePipelineState.cs index ead12b79546..70f0ca212b1 100644 --- a/src/Microsoft.Diagnostics.Monitoring.WebApi/CollectionRulePipelineState.cs +++ b/src/Microsoft.Diagnostics.Monitoring.WebApi/CollectionRulePipelineState.cs @@ -231,6 +231,11 @@ private static void DequeueOldTimestamps(Queue executionTimestamps, Ti } } + private static void TestMethod() + { + int myNum = 1 + 2; + } + # LP 5d8697c3-3ded-43df-a349-4b21207010a6 private static bool CheckForThrottling(int actionCountLimit, TimeSpan? actionCountSWD, int executionTimestampsCount) { From bea1cb221f36cf45aef4aeb32053b7aecf559024 Mon Sep 17 00:00:00 2001 From: kkeirstead <85592574+kkeirstead@users.noreply.github.com> Date: Fri, 6 Oct 2023 14:35:57 -0700 Subject: [PATCH 44/44] Update CollectionRulePipelineState.cs --- .../CollectionRulePipelineState.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Microsoft.Diagnostics.Monitoring.WebApi/CollectionRulePipelineState.cs b/src/Microsoft.Diagnostics.Monitoring.WebApi/CollectionRulePipelineState.cs index 70f0ca212b1..c25ddcfbfb7 100644 --- a/src/Microsoft.Diagnostics.Monitoring.WebApi/CollectionRulePipelineState.cs +++ b/src/Microsoft.Diagnostics.Monitoring.WebApi/CollectionRulePipelineState.cs @@ -236,7 +236,7 @@ private static void TestMethod() int myNum = 1 + 2; } - # LP 5d8697c3-3ded-43df-a349-4b21207010a6 + // # LP 5d8697c3-3ded-43df-a349-4b21207010a6 private static bool CheckForThrottling(int actionCountLimit, TimeSpan? actionCountSWD, int executionTimestampsCount) { return actionCountSWD.HasValue && actionCountLimit <= executionTimestampsCount;