This repository was archived by the owner on Jun 21, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +16
-4
lines changed
GitHub.InlineReviews/Services Expand file tree Collapse file tree 2 files changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -42,6 +42,8 @@ public struct UsageModel
4242 public int NumberOfPRDetailsNavigateToEditor { get ; set ; }
4343 public int NumberOfPRReviewDiffViewInlineCommentOpen { get ; set ; }
4444 public int NumberOfPRReviewDiffViewInlineCommentPost { get ; set ; }
45+ public int NumberOfPRReviewDiffViewInlineCommentStartReview { get ; set ; }
46+ public int NumberOfPRReviewPosts { get ; set ; }
4547 public int NumberOfShowCurrentPullRequest { get ; set ; }
4648
4749 public UsageModel Clone ( bool includeWeekly , bool includeMonthly )
Original file line number Diff line number Diff line change @@ -344,7 +344,9 @@ public async Task<IPullRequestReviewModel> CreatePendingReview(
344344 User = user ,
345345 } ) ;
346346
347- return await graphql . Run ( addReview ) ;
347+ var result = await graphql . Run ( addReview ) ;
348+ await usageTracker . IncrementCounter ( x => x . NumberOfPRReviewDiffViewInlineCommentStartReview ) ;
349+ return result ;
348350 }
349351
350352 /// <inheritdoc/>
@@ -368,6 +370,8 @@ public async Task<IPullRequestReviewModel> PostReview(
368370 body ,
369371 e ) ;
370372
373+ await usageTracker . IncrementCounter ( x => x . NumberOfPRReviewPosts ) ;
374+
371375 return new PullRequestReviewModel
372376 {
373377 Id = result . Id ,
@@ -407,7 +411,9 @@ public async Task<IPullRequestReviewModel> SubmitPendingReview(
407411 User = user ,
408412 } ) ;
409413
410- return await graphql . Run ( mutation ) ;
414+ var result = await graphql . Run ( mutation ) ;
415+ await usageTracker . IncrementCounter ( x => x . NumberOfPRReviewPosts ) ;
416+ return result ;
411417 }
412418
413419 /// <inheritdoc/>
@@ -451,7 +457,9 @@ public async Task<IPullRequestReviewCommentModel> PostPendingReviewComment(
451457 IsPending = true ,
452458 } ) ;
453459
454- return await graphql . Run ( addComment ) ;
460+ var result = await graphql . Run ( addComment ) ;
461+ await usageTracker . IncrementCounter ( x => x . NumberOfPRReviewDiffViewInlineCommentPost ) ;
462+ return result ;
455463 }
456464
457465 /// <inheritdoc/>
@@ -491,7 +499,9 @@ public async Task<IPullRequestReviewCommentModel> PostPendingReviewCommentReply(
491499 IsPending = true ,
492500 } ) ;
493501
494- return await graphql . Run ( addComment ) ;
502+ var result = await graphql . Run ( addComment ) ;
503+ await usageTracker . IncrementCounter ( x => x . NumberOfPRReviewDiffViewInlineCommentPost ) ;
504+ return result ;
495505 }
496506
497507 /// <inheritdoc/>
You can’t perform that action at this time.
0 commit comments