Skip to content

Commit

Permalink
Merge branch 'main' into docs-metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
trivikr authored Jun 28, 2024
2 parents 0c9261c + 6ab5164 commit d1daaa4
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 17 deletions.
4 changes: 2 additions & 2 deletions ansible/roles/baselayout/tasks/partials/ccache/aix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@
- g++
- gcc
- gcov
- g++-6
- gcc-6
- g++-8
- gcc-8
- gcc-10
- g++-10
- gcc-12
- g++-12

- name: "ccache : cleanup - aix tarball"
file:
Expand Down
4 changes: 2 additions & 2 deletions ansible/roles/baselayout/vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ packages: {
],

aix72: [
'gcc6-c++,gcc8-c++,gcc10-c++'
'gcc8-c++,gcc10-c++,gcc12-c++'
],

aix73: [
'gcc8-c++,gcc10-c++'
'gcc8-c++,gcc10-c++,gcc12-c++'
],

ibmi: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
"@google-cloud/storage": "^5.0.0",
"body-parser": "^1.19.0",
"express": "^4.17.1",
"moment": "^2.29.1",
"split2": "~3.1.1",
"strftime": "~0.10.0"
},
Expand Down
3 changes: 1 addition & 2 deletions ansible/roles/metrics/files/summaries/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
"dependencies": {
"@google-cloud/storage": "^5.0.0",
"body-parser": "^1.19.0",
"express": "^4.17.1",
"moment": "^2.29.1"
"express": "^4.17.1"
},
"devDependencies": {
"eslint": "^7.8.1"
Expand Down
16 changes: 7 additions & 9 deletions ansible/roles/metrics/files/summaries/summaries.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
//

const { Storage } = require('@google-cloud/storage')
const moment = require('moment')
const express = require('express')
const bodyParser = require('body-parser')
const app = express()
Expand Down Expand Up @@ -65,10 +64,8 @@ function summary (chunk) {
return
}

async function collectData () {
async function collectData (date) {
const storage = new Storage()
let date = moment(new Date())
date = moment(date, 'YYYYMMDD').subtract(1, 'days').format('YYYYMMDD')
const filePrefix = date.toString().concat('/')
console.log(filePrefix)
const [files] = await storage.bucket('processed-logs-nodejs').getFiles({ prefix: `${filePrefix}`})
Expand All @@ -85,12 +82,10 @@ async function collectData () {
}
}

async function produceSummaries () {
async function produceSummaries (date) {
const storage = new Storage()
await collectData()
await collectData(date)
prepare()
let date = moment(new Date())
date = moment(date, 'YYYYMMDD').subtract(1, 'days').format('YYYYMMDD')
let outputFile = "nodejs.org-access.log." + date.toString() + ".json"
storage.bucket('access-logs-summaries-nodejs').file(outputFile).save(JSON.stringify(counts), function (err) {
if (err) {
Expand All @@ -102,7 +97,10 @@ async function produceSummaries () {
}

app.post('/', async (req, res) => {
await produceSummaries()
// ToDo: accept optional date parameter https://github.com/nodejs/build/issues/3780
const yesterday = new Date().getTime() - (24 * 60 * 60 * 1000)
const date = new Date(yesterday).toISOString().slice(0, 10).replace(/-/g, '')
await produceSummaries(date)
res.status(200).send()
})

Expand Down
2 changes: 1 addition & 1 deletion ansible/roles/visual-studio/tasks/partials/vs2022.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
- name: install Visual Studio Community 2022 Native Desktop Workload
win_chocolatey:
name: visualstudio2022-workload-nativedesktop
params: '--add Microsoft.VisualStudio.Component.VC.Tools.ARM64 --add Microsoft.VisualStudio.Component.VC.ATL.ARM64 --add Microsoft.NetCore.Component.SDK --add Microsoft.VisualStudio.Component.VC.Llvm.Clang'
params: '--add Microsoft.VisualStudio.Component.VC.Tools.ARM64 --add Microsoft.VisualStudio.Component.VC.ATL.ARM64 --add Microsoft.NetCore.Component.SDK --add Microsoft.VisualStudio.Component.VC.Llvm.Clang --add Microsoft.VisualStudio.Component.VC.Llvm.ClangToolset'

- name: install WiX Toolset
import_tasks: 'wixtoolset.yml'
Expand Down

0 comments on commit d1daaa4

Please sign in to comment.