diff --git a/gruntfile.js b/gruntfile.js index e2f88d3cc..0e5f15e47 100644 --- a/gruntfile.js +++ b/gruntfile.js @@ -803,6 +803,13 @@ module.exports = function (grunt) { { src: "./tools/config/config.json", dest: `./tools/config/browser/es5/ai.config${configVer}.cfg.json` }, { src: "./tools/config/config.json", dest: `./tools/config/browser/es5/ai.config${configMajorVer}.cfg.json` } ] + }, + + testConfig: { + files: [ + { src: "./tools/config/test-config.json", dest: `./tools/config/browser/es5/ai_test.config${configVer}.cfg.json` }, + { src: "./tools/config/test-config.json", dest: `./tools/config/browser/es5/ai_test.config${configMajorVer}.cfg.json` } + ] } } })); @@ -955,6 +962,7 @@ module.exports = function (grunt) { grunt.registerTask("serve", ["connect:server:keepalive"]); grunt.registerTask("copy-config", ["copy:config"]); + grunt.registerTask("copy-testConfig", ["copy:testConfig"]); grunt.registerTask("example-aisku", tsBuildActions("example-aisku")); grunt.registerTask("example-dependency", tsBuildActions("example-dependency")); diff --git a/tools/config/package.json b/tools/config/package.json index ae569f4b3..edb9f7a84 100644 --- a/tools/config/package.json +++ b/tools/config/package.json @@ -10,8 +10,9 @@ }, "scripts": { "clean": "git clean -xdf", - "build": "npm run build:browser", + "build": "npm run build:browser && npm run build:test", "build:browser": "grunt copy-config", + "build:test": "grunt copy-testConfig", "rebuild": "npm run build", "test": "" }, diff --git a/tools/config/test-config.json b/tools/config/test-config.json new file mode 100644 index 000000000..009dee959 --- /dev/null +++ b/tools/config/test-config.json @@ -0,0 +1,42 @@ +{ + "version": "1.0.0", + "enabled": true, + "featureOptIn": { + "iKeyUsage": { + "mode": 3, + "onCfg": { + "throttleMgrCfg.109.disabled": false, + "throttleMgrCfg.106.disabled": false + }, + "offCfg": { + "throttleMgrCfg.109.disabled": true, + "throttleMgrCfg.106.disabled": true + } + } + }, + "config": { + "throttleMgrCfg": { + "109": { + "disabled": false, + "limit": { + "samplingRate": 2000000, + "maxSendNumber": 1 + }, + "interval": { + "dayInterval": 2 + } + }, + "106": { + "disabled": false, + "limit": { + "samplingRate": 1, + "maxSendNumber": 1 + }, + "interval": { + "monthInterval": 2, + "daysOfMonth": [1] + } + } + } + } +} \ No newline at end of file diff --git a/tools/github-page-script-injection/injectScript.js b/tools/github-page-script-injection/injectScript.js index b5952f935..c8f7ea9f2 100644 --- a/tools/github-page-script-injection/injectScript.js +++ b/tools/github-page-script-injection/injectScript.js @@ -31,7 +31,9 @@ let scriptContent = fs.readFileSync(scriptFilePath, 'utf8'); // Replace the placeholder string with the actual connection string const connectionString = 'InstrumentationKey=1ae9e7ce-18f1-4e14-8fc0-acbf0ed28895;IngestionEndpoint=https://eastus-8.in.applicationinsights.azure.com/;LiveEndpoint=https://eastus.livediagnostics.monitor.azure.com/'; let iKeyForCfgSync = "1ae9e7ce-18f1-4e14-8fc0-acbf0ed28895"; -scriptContent = scriptContent.replace(`connectionString: "YOUR_CONNECTION_STRING"`, `instrumentationKey: "${iKeyForCfgSync}",\n \texpCfg: {\n\t\tinclScripts: true,\n\t\t\n\t\tmaxLogs: 100},\n\t\textensionConfig: {\n\t\t\t"AppInsightsCfgSyncPlugin": {\n\t\t\t\tcfgUrl:"https://js.monitor.azure.com/beta/ai.config.1.cfg.json"\n\t\t\t}\n\t\t}`); +//let cfgUrl = "https://js.monitor.azure.com/beta/ai.config.1.cfg.json"; +let cfgUrl = "https://js.monitor.azure.com/nightly/ai_test.config.1-nightly3.cfg.json"; +scriptContent = scriptContent.replace(`connectionString: "YOUR_CONNECTION_STRING"`, `instrumentationKey: "${iKeyForCfgSync}",\n \texpCfg: {\n\t\tinclScripts: true,\n\t\t\n\t\tmaxLogs: 100},\n \t\textensionConfig: {\n\t\t\t"AppInsightsCfgSyncPlugin": {\n\t\t\t\tcfgUrl:"${cfgUrl}"\n\t\t\t}\n\t\t}`); //scriptContent = scriptContent.replace('YOUR_CONNECTION_STRING', connectionString); scriptContent = ``;