Skip to content

Commit cad66a6

Browse files
Sue GarnerSue Garner
authored andcommitted
MAS-252 Added timings round list items api call
1 parent e786e2f commit cad66a6

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

cms/routes/api/items.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ exports.daily = async function(req, res) {
100100
* /api/items/month/2020-01
101101
*/
102102
exports.month = async function(req, res) {
103+
const start = Date.now();
103104
const dateStr = req.params.date,
104105
date = moment(dateStr, "YYYY-M", true);
105106

@@ -130,6 +131,8 @@ exports.month = async function(req, res) {
130131
const obj = _.map(items, _.partialRight(_.pick, Items.fullResponseFields));
131132

132133
res.json(obj);
134+
const millis = Date.now() - start;
135+
console.log(`seconds elapsed = ${Math.floor(millis / 1000)}`);
133136
};
134137

135138
/**

0 commit comments

Comments
 (0)