Skip to content

Commit

Permalink
feat(pg-v5): Add pg:settings:track-functions (heroku#1854)
Browse files Browse the repository at this point in the history
  • Loading branch information
mble authored Aug 24, 2021
1 parent b89fcc0 commit 68a4cf7
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
22 changes: 22 additions & 0 deletions packages/pg-v5/commands/settings/track_functions.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
'use strict'

const cli = require('heroku-cli-util')
const settings = require('../../lib/setter')

function explain (setting) {
return setting.values[setting.value]
}

module.exports = {
topic: 'pg',
command: 'settings:track-functions',
description: `track_functions controls tracking of function call counts and time used. Default is none.`,
help: `Valid values for VALUE:
none - No functions are tracked
pl - Only procedural language functions are tracked
all - All functions, including SQL and C language functions, are tracked. Simple SQL-language that are inlined are not tracked`,
needsApp: true,
needsAuth: true,
args: [{ name: 'value', optional: true }, { name: 'database', optional: true }],
run: cli.command({ preauth: true }, settings.generate('track_functions', settings.enum, explain))
}
1 change: 1 addition & 0 deletions packages/pg-v5/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ exports.commands = flatten([
require('./commands/settings/log_lock_waits'),
require('./commands/settings/log_min_duration_statement'),
require('./commands/settings/log_statement'),
require('./commands/settings/track_functions'),
require('./commands/unfollow'),
require('./commands/upgrade'),
require('./commands/vacuum_stats'),
Expand Down

0 comments on commit 68a4cf7

Please sign in to comment.