Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove metrics code #10

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions lib/controllers/comment-gutter-decoration-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {EndpointPropType} from '../prop-types';
import Decoration from '../atom/decoration';
import Marker from '../atom/marker';
import ReviewsItem from '../items/reviews-item';
import {addEvent} from '../reporter-proxy';

export default class CommentGutterDecorationController extends React.Component {
static propTypes = {
Expand All @@ -20,9 +19,6 @@ export default class CommentGutterDecorationController extends React.Component {
number: PropTypes.number.isRequired,
workdir: PropTypes.string.isRequired,
editor: PropTypes.object,

// For metric reporting
parent: PropTypes.string.isRequired,
};

static defaultProps = {
Expand Down Expand Up @@ -60,7 +56,6 @@ export default class CommentGutterDecorationController extends React.Component {
});
const reviewsItem = await this.props.workspace.open(uri, {searchAllPanes: true});
reviewsItem.jumpToThread(threadId);
addEvent('open-review-thread', {package: 'github', from: this.props.parent});
}

}
3 changes: 0 additions & 3 deletions lib/controllers/commit-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import CommitPreviewItem from '../items/commit-preview-item';
import {AuthorPropType, UserStorePropType} from '../prop-types';
import {watchWorkspaceItem} from '../watch-workspace-item';
import {autobind} from '../helpers';
import {addEvent} from '../reporter-proxy';

export const COMMIT_GRAMMAR_SCOPE = 'text.git-commit';

Expand Down Expand Up @@ -234,7 +233,6 @@ export default class CommitController extends React.Component {
async openCommitMessageEditor(messageFromBox) {
await fs.writeFile(this.getCommitMessagePath(), messageFromBox, 'utf8');
const commitEditor = await this.props.workspace.open(this.getCommitMessagePath());
addEvent('open-commit-message-editor', {package: 'github'});

const grammar = this.props.grammars.grammarForScopeName(COMMIT_GRAMMAR_SCOPE);
if (grammar) {
Expand Down Expand Up @@ -269,7 +267,6 @@ export default class CommitController extends React.Component {
}

toggleCommitPreview() {
addEvent('toggle-commit-preview', {package: 'github'});
const uri = CommitPreviewItem.buildURI(this.props.repository.getWorkingDirectoryPath());
if (this.props.workspace.hide(uri)) {
return Promise.resolve();
Expand Down
2 changes: 0 additions & 2 deletions lib/controllers/editor-comment-decorations-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import PropTypes from 'prop-types';
import {Range} from 'atom';

import {EndpointPropType} from '../prop-types';
import {addEvent} from '../reporter-proxy';
import Marker from '../atom/marker';
import Decoration from '../atom/decoration';
import ReviewsItem from '../items/reviews-item';
Expand Down Expand Up @@ -163,7 +162,6 @@ export default class EditorCommentDecorationsController extends React.Component
});
const reviewsItem = await this.props.workspace.open(uri, {searchAllPanes: true});
reviewsItem.jumpToThread(threadId);
addEvent('open-review-thread', {package: 'github', from: this.constructor.name});
}
}

Expand Down
3 changes: 0 additions & 3 deletions lib/controllers/github-tab-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {
RefresherPropType,
} from '../prop-types';
import GitHubTabView from '../views/github-tab-view';
import {incrementCounter} from '../reporter-proxy';

export default class GitHubTabController extends React.Component {
static propTypes = {
Expand Down Expand Up @@ -96,12 +95,10 @@ export default class GitHubTabController extends React.Component {
openBoundPublishDialog = () => this.props.openPublishDialog(this.props.repository);

handleLogin = token => {
incrementCounter('github-login');
this.props.loginModel.setToken(this.currentEndpoint().getLoginAccount(), token);
}

handleLogout = () => {
incrementCounter('github-logout');
this.props.loginModel.removeToken(this.currentEndpoint().getLoginAccount());
}

Expand Down
3 changes: 0 additions & 3 deletions lib/controllers/issueish-detail-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {
import IssueDetailView from '../views/issue-detail-view';
import CommitDetailItem from '../items/commit-detail-item';
import ReviewsItem from '../items/reviews-item';
import {addEvent} from '../reporter-proxy';
import PullRequestCheckoutController from './pr-checkout-controller';
import PullRequestDetailView from '../views/pr-detail-view';

Expand Down Expand Up @@ -184,7 +183,6 @@ export class BareIssueishDetailController extends React.Component {

const uri = CommitDetailItem.buildURI(this.props.workdirPath, sha);
await this.props.workspace.open(uri, {pending: true});
addEvent('open-commit-in-pane', {package: 'github', from: this.constructor.name});
}

openReviews = async () => {
Expand All @@ -201,7 +199,6 @@ export class BareIssueishDetailController extends React.Component {
workdir: this.props.workdirPath,
});
await this.props.workspace.open(uri);
addEvent('open-reviews-tab', {package: 'github', from: this.constructor.name});
}

getTypename() {
Expand Down
2 changes: 0 additions & 2 deletions lib/controllers/issueish-list-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import IssueishListView from '../views/issueish-list-view';
import Issueish from '../models/issueish';
import {shell, remote} from 'electron';
const {Menu, MenuItem} = remote;
import {addEvent} from '../reporter-proxy';

const StatePropType = PropTypes.oneOf(['EXPECTED', 'PENDING', 'SUCCESS', 'ERROR', 'FAILURE']);

Expand Down Expand Up @@ -92,7 +91,6 @@ export class BareIssueishListController extends React.Component {

openOnGitHub = async url => {
await shell.openExternal(url);
addEvent('open-issueish-in-browser', {package: 'github', component: this.constructor.name});
}

showActionsMenu = /* istanbul ignore next */ issueish => {
Expand Down
9 changes: 2 additions & 7 deletions lib/controllers/issueish-searches-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import IssueishSearchContainer from '../containers/issueish-search-container';
import CurrentPullRequestContainer from '../containers/current-pull-request-container';
import IssueishDetailItem from '../items/issueish-detail-item';
import ReviewsItem from '../items/reviews-item';
import {addEvent} from '../reporter-proxy';

export default class IssueishSearchesController extends React.Component {
static propTypes = {
Expand Down Expand Up @@ -93,9 +92,7 @@ export default class IssueishSearchesController extends React.Component {
number: issueish.getNumber(),
workdir: this.props.workingDirectory,
});
return this.props.workspace.open(uri).then(() => {
addEvent('open-reviews-tab', {package: 'github', from: this.constructor.name});
});
return this.props.workspace.open(uri);
}

onOpenIssueish = issueish => {
Expand All @@ -108,9 +105,7 @@ export default class IssueishSearchesController extends React.Component {
workdir: this.props.workingDirectory,
}),
{pending: true, searchAllPanes: true},
).then(() => {
addEvent('open-issueish-in-pane', {package: 'github', from: 'issueish-list'});
});
);
}

onOpenSearch = async search => {
Expand Down
18 changes: 2 additions & 16 deletions lib/controllers/multi-file-patch-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import PropTypes from 'prop-types';
import path from 'path';

import {autobind, equalSets} from '../helpers';
import {addEvent} from '../reporter-proxy';
import {MultiFilePatchPropType} from '../prop-types';
import ChangedFileItem from '../items/changed-file-item';
import MultiFilePatchView from '../views/multi-file-patch-view';
Expand Down Expand Up @@ -95,13 +94,7 @@ export default class MultiFilePatchController extends React.Component {
);
}

undoLastDiscard(filePatch, {eventSource} = {}) {
addEvent('undo-last-discard', {
package: 'github',
component: this.constructor.name,
eventSource,
});

undoLastDiscard(filePatch) {
return this.props.undoLastDiscard(filePatch.getPath(), this.props.repository);
}

Expand Down Expand Up @@ -189,7 +182,7 @@ export default class MultiFilePatchController extends React.Component {
});
}

async discardRows(rowSet, nextSelectionMode, {eventSource} = {}) {
async discardRows(rowSet, nextSelectionMode) {
// (kuychaco) For now we only support discarding rows for MultiFilePatches that contain a single file patch
// The only way to access this method from the UI is to be in a ChangedFileItem, which only has a single file patch
// This check is duplicated in RootController#discardLines. We also want it here to prevent us from sending metrics
Expand All @@ -206,13 +199,6 @@ export default class MultiFilePatchController extends React.Component {
chosenRows = this.state.selectedRows;
}

addEvent('discard-unstaged-changes', {
package: 'github',
component: this.constructor.name,
lineCount: chosenRows.size,
eventSource,
});

return this.props.discardLines(this.props.multiFilePatch, chosenRows, this.props.repository);
}

Expand Down
7 changes: 1 addition & 6 deletions lib/controllers/pr-checkout-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {graphql, createFragmentContainer} from 'react-relay';
import EnableableOperation from '../models/enableable-operation';
import {GitError} from '../git-shell-out-strategy';
import {RemoteSetPropType, BranchSetPropType} from '../prop-types';
import {incrementCounter} from '../reporter-proxy';

class CheckoutState {
constructor(name) {
Expand Down Expand Up @@ -174,9 +173,7 @@ export class BarePullRequestCheckoutController extends React.Component {
await this.props.localRepository.checkout(localRefName);
try {
await this.props.localRepository.pull(fullHeadRef, {remoteName: sourceRemoteName, ffOnly: true});
} finally {
incrementCounter('checkout-pr');
}
} catch (e) {}

return;
}
Expand All @@ -188,8 +185,6 @@ export class BarePullRequestCheckoutController extends React.Component {
`pr-${pullRequest.number}/${headRepository.owner.login}/${pullRequest.headRefName}`,
{createNew: true, track: true, startPoint: `refs/remotes/${sourceRemoteName}/${pullRequest.headRefName}`,
});

incrementCounter('checkout-pr');
}
}

Expand Down
3 changes: 0 additions & 3 deletions lib/controllers/reaction-picker-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import PropTypes from 'prop-types';

import ReactionPickerView from '../views/reaction-picker-view';
import {RefHolderPropType} from '../prop-types';
import {addEvent} from '../reporter-proxy';

export default class ReactionPickerController extends React.Component {
static propTypes = {
Expand All @@ -25,13 +24,11 @@ export default class ReactionPickerController extends React.Component {

addReactionAndClose = async content => {
await this.props.addReaction(content);
addEvent('add-emoji-reaction', {package: 'github'});
this.props.tooltipHolder.map(tooltip => tooltip.dispose());
}

removeReactionAndClose = async content => {
await this.props.removeReaction(content);
addEvent('remove-emoji-reaction', {package: 'github'});
this.props.tooltipHolder.map(tooltip => tooltip.dispose());
}
}
2 changes: 0 additions & 2 deletions lib/controllers/recent-commits-controller.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React from 'react';
import PropTypes from 'prop-types';
import {addEvent} from '../reporter-proxy';
import {CompositeDisposable} from 'event-kit';

import CommitDetailItem from '../items/commit-detail-item';
Expand Down Expand Up @@ -76,7 +75,6 @@ export default class RecentCommitsController extends React.Component {
item.preventFocus();
this.setFocus(this.constructor.focus.RECENT_COMMIT);
}
addEvent('open-commit-in-pane', {package: 'github', from: this.constructor.name});
}

// When no commit is selected, `getSelectedCommitIndex` returns -1 & the commit at index 0 (first commit) is selected
Expand Down
2 changes: 0 additions & 2 deletions lib/controllers/remote-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import React from 'react';
import PropTypes from 'prop-types';
import {shell} from 'electron';

import {incrementCounter} from '../reporter-proxy';
import {RemotePropType, RemoteSetPropType, BranchSetPropType, EndpointPropType, TokenPropType} from '../prop-types';
import IssueishSearchesController from './issueish-searches-controller';

Expand Down Expand Up @@ -68,6 +67,5 @@ export default class RemoteController extends React.Component {
createPrUrl += '?expand=1';

await shell.openExternal(createPrUrl);
incrementCounter('create-pull-request');
}
}
11 changes: 0 additions & 11 deletions lib/controllers/reviews-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import unresolveReviewThreadMutation from '../mutations/unresolve-review-thread'
import updatePrReviewCommentMutation from '../mutations/update-pr-review-comment';
import updatePrReviewSummaryMutation from '../mutations/update-pr-review-summary';
import IssueishDetailItem from '../items/issueish-detail-item';
import {addEvent} from '../reporter-proxy';

// Milliseconds to update highlightedThreadIDs
const FLASH_DELAY = 1500;
Expand Down Expand Up @@ -165,7 +164,6 @@ export class BareReviewsController extends React.Component {
initialColumn: 0,
pending: true,
});
addEvent('reviews-dock-open-file', {package: 'github'});
}

openDiff = async (filePath, lineNumber) => {
Expand All @@ -174,12 +172,10 @@ export class BareReviewsController extends React.Component {
changedFilePath: filePath,
changedFilePosition: lineNumber,
});
addEvent('reviews-dock-open-diff', {package: 'github', component: this.constructor.name});
}

openPR = async () => {
await this.getPRDetailItem();
addEvent('reviews-dock-open-pr', {package: 'github', component: this.constructor.name});
}

getPRDetailItem = () => {
Expand All @@ -199,12 +195,10 @@ export class BareReviewsController extends React.Component {

moreContext = () => {
this.setState(prev => ({contextLines: prev.contextLines + 1}));
addEvent('reviews-dock-show-more-context', {package: 'github'});
}

lessContext = () => {
this.setState(prev => ({contextLines: Math.max(prev.contextLines - 1, 1)}));
addEvent('reviews-dock-show-less-context', {package: 'github'});
}

openIssueish = async (owner, repo, number) => {
Expand Down Expand Up @@ -265,7 +259,6 @@ export class BareReviewsController extends React.Component {
viewerLogin: this.props.viewer.login,
});
this.highlightThread(thread.id);
addEvent('resolve-comment-thread', {package: 'github'});
} catch (err) {
this.showThreadID(thread.id);
this.props.reportRelayError('Unable to resolve the comment thread', err);
Expand All @@ -282,7 +275,6 @@ export class BareReviewsController extends React.Component {
viewerLogin: this.props.viewer.login,
});
this.highlightThread(thread.id);
addEvent('unresolve-comment-thread', {package: 'github'});
} catch (err) {
this.props.reportRelayError('Unable to unresolve the comment thread', err);
}
Expand Down Expand Up @@ -320,7 +312,6 @@ export class BareReviewsController extends React.Component {
event: 'COMMENT',
reviewID,
});
addEvent('add-single-comment', {package: 'github'});
} catch (error) {
if (callbacks.didFailComment) {
callbacks.didFailComment();
Expand Down Expand Up @@ -355,7 +346,6 @@ export class BareReviewsController extends React.Component {
commentId,
commentBody,
});
addEvent('update-review-comment', {package: 'github'});
} catch (error) {
this.props.reportRelayError('Unable to update comment', error);
throw error;
Expand All @@ -368,7 +358,6 @@ export class BareReviewsController extends React.Component {
reviewId,
reviewBody,
});
addEvent('update-review-summary', {package: 'github'});
} catch (error) {
this.props.reportRelayError('Unable to update review summary', error);
throw error;
Expand Down
Loading