Skip to content

Commit

Permalink
Renaming blame to show to make it less confrontational
Browse files Browse the repository at this point in the history
  • Loading branch information
pcon committed Aug 4, 2018
1 parent 4ca91b2 commit 46f5037
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 15 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@ events_Login.json
events_API.json
```

## Blame
This sub command "blames" users for doing things
## Show
This sub command shows users doing things

**Flags**
* **--format \[format\]** - json, table - The format the output should be displayed in
Expand All @@ -156,7 +156,7 @@ Data around users and API usage
The summary mode can be useful for getting an idea of the overal usage of your API

```bash
eventmonitoring blame apiusage --summary
eventmonitoring show apiusage --summary
```

```text
Expand All @@ -176,7 +176,7 @@ eventmonitoring blame apiusage --summary
For more information you can get a breakdown per user per endpoint

```bash
eventmonitoring blame apiusage --limit 3 --sublimit 4
eventmonitoring show apiusage --limit 3 --sublimit 4
```

```text
Expand Down Expand Up @@ -560,4 +560,4 @@ module.exports = {
╟─────────────────────────────────────┼────────────┼──────────┼──────────┼─────────────────┼───────────────┼─────────────┼───────────────╢
║ /apex/casetag │ Custom 3 │ 298ms │ 470ms │ 13.9 kB │ 44.2 kB │ 104ms │ 140ms ║
╚═════════════════════════════════════╧════════════╧══════════╧══════════╧═════════════════╧═══════════════╧═════════════╧═══════════════╝
```
```
4 changes: 2 additions & 2 deletions eventmonitoring.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ var pkg = require('./package.json');

var config = require('./src/lib/config.js');

var blame = require('./src/blame.js');
var show = require('./src/show.js');
var cache = require('./src/cache.js');
var dump = require('./src/dump.js');
var login = require('./src/login.js');
Expand Down Expand Up @@ -50,7 +50,7 @@ var run = function () {
.options(OPTIONS)
.conflicts(CONFLICTS)
.version(pkg.version)
.command('blame [type]', 'Blame users', blame.config, blame.run)
.command('show [type]', 'Show user information', show.config, show.run)
.command('cache [action]', 'Interact with cache', cache.config, cache.run)
.command('dump', 'Dump data', dump.config, dump.run)
.command('login [type]', 'Login information', login.config, login.run)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sfdc-eventmonitoring",
"version": "0.1.9",
"version": "0.1.10",
"description": "Command line tools surrounding event monitoring",
"main": "eventmonitoring.js",
"bin": {
Expand Down
4 changes: 2 additions & 2 deletions src/lib/queries.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ var getAllLogs = function (types) {
* Gets the query for all the "API" usage types
* @returns {string} The query
*/
var blameAPIUsage = function () {
var showAPIUsage = function () {
var criteria = [
getLogDate(),
getInterval(),
Expand Down Expand Up @@ -234,7 +234,7 @@ var reportVisualforce = function () {
};

var queries = {
blame: { apiusage: blameAPIUsage },
show: { apiusage: showAPIUsage },
login: login,
functions: {
buildSimpleQuery: buildSimpleQuery,
Expand Down
4 changes: 2 additions & 2 deletions src/blame.js → src/show.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
var conf = require('./lib/config.js');
var sfdc = require('./lib/sfdc.js');

var apiusage = require('./blame/apiusage.js');
var apiusage = require('./show/apiusage.js');

var handlers = { apiusage: apiusage.run };

Expand All @@ -24,7 +24,7 @@ var OPTIONS = conf.yargs.generateOptions([
function config(yargs) {
'use strict';

var pdata = conf.yargs.generateTypePdata('Blame your users that are doing stuff', handlers);
var pdata = conf.yargs.generateTypePdata('Show your users that are doing stuff', handlers);
conf.yargs.config(yargs, pdata, OPTIONS);
}

Expand Down
2 changes: 1 addition & 1 deletion src/blame/apiusage.js → src/show/apiusage.js
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ var run = function () {

updatefilterCriteria();

sfdc.query(queries.blame.apiusage())
sfdc.query(queries.show.apiusage())
.then(utils.fetchAndConvert)
.then(groupByUserIdAndName)
.then(fetchUsernames)
Expand Down
4 changes: 2 additions & 2 deletions tests/lib/queries.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,9 @@ describe('Get all logs', function () {
});
});

test('Get blame usage', function () {
test('Get show usage', function () {
global.config = { interval: 'hourly' };
expect(queries.blame.apiusage()).toEqual('select Id, EventType, LogFile, LogDate, LogFileLength from EventLogFile where LogDate = TODAY and Interval = \'Hourly\' and EventType in (\'ApexSoap\',\'API\',\'RestAPI\')');
expect(queries.show.apiusage()).toEqual('select Id, EventType, LogFile, LogDate, LogFileLength from EventLogFile where LogDate = TODAY and Interval = \'Hourly\' and EventType in (\'ApexSoap\',\'API\',\'RestAPI\')');
});

test('Login', function () {
Expand Down

0 comments on commit 46f5037

Please sign in to comment.