points.tablePivot().map((item) => { data['features'].push({ type: 'Feature', properties: { value: parseInt(item['Users.max']), }, geometry: JSON.parse(item['Users.geometry']), }); });
Object.keys(ifaces).forEach(function(ifname) { ifaces[ifname].forEach(function (iface) { if (iface.internal) { return; } info[iface.family == 'IPv4' ? 'ipv4' : 'ipv6'].push(iface.address); }); });
it('should return too many data points error if there are >3000 data points', async () => { const datapoints = { 1: [] } for (let i = 0; i < 3001; i++) { datapoints[1].push({}) } sinon.stub(Metric.prototype, 'insertDatapoints').returns() sinon.stub(MetricsStoreProxy.prototype, 'get').returns() return await handle(datapoints, null, (error, result) => { error = JSON.parse(error) assert(error.length === 1) assert(error[0].message.match(/too many/)) }) })
resultSet .tablePivot() .filter((item) => item['MapboxCoords.coordinates'] != null) .map((item) => { data['features'].push({ type: 'Feature', properties: { name: item['Users.country'], value: parseInt(item[`Users.${mode}`]) }, geometry: { type: 'Polygon', coordinates: [item['MapboxCoords.coordinates'].split(';').map((item) => item.split(','))] } }); });
answersSet.tablePivot().map((item) => { dataAnswers['features'].push({ type: 'Feature', geometry: JSON.parse(item['Users.geometry']), }); });
resultSet.tablePivot().map((item) => { data['features'].push({ type: 'Feature', properties: { value: parseInt(item['Users.count']), }, geometry: JSON.parse(item['Users.geometry']), }); });
questionsSet.tablePivot().map((item) => { dataQuestions['features'].push({ type: 'Feature', properties: { count: item['Questions.count'], geometry: item['Users.geometry'], id: item['Users.id'], }, geometry: JSON.parse(item['Users.geometry']) }); });
resultSet.tablePivot().map((item) => { data['features'].push({ type: 'Feature', properties: { value: parseInt(item['Users.count']), }, geometry: JSON.parse(item['Users.geometry']), }); });
points.tablePivot().map((item) => { data['features'].push({ type: 'Feature', properties: { value: parseInt(item['Users.max']), }, geometry: JSON.parse(item['Users.geometry']), }); });
questionsSet.tablePivot().map((item) => { dataQuestions['features'].push({ type: 'Feature', properties: { count: item['Questions.count'], geometry: item['Users.geometry'], id: item['Users.id'], }, geometry: JSON.parse(item['Users.geometry']) }); });
answersSet.tablePivot().map((item) => { dataAnswers['features'].push({ type: 'Feature', geometry: JSON.parse(item['Users.geometry']), }); });
it('should return too many data points error if there are >3000 data points', async () => { const datapoints = { 1: [] } for (let i = 0; i < 3001; i++) { datapoints[1].push({}) } sinon.stub(Metric.prototype, 'insertDatapoints').returns() sinon.stub(MetricsStoreProxy.prototype, 'get').returns() return await handle(datapoints, null, (error, result) => { error = JSON.parse(error) assert(error.length === 1) assert(error[0].message.match(/too many/)) }) })
resultSet .tablePivot() .filter((item) => item['MapboxCoords.coordinates'] != null) .map((item) => { data['features'].push({ type: 'Feature', properties: { name: item['Users.country'], value: parseInt(item[`Users.${mode}`]) }, geometry: { type: 'Polygon', coordinates: [item['MapboxCoords.coordinates'].split(';').map((item) => item.split(','))] } }); });