mirror of
https://github.com/mupen64plus-ae/acra-storage.git
synced 2024-11-23 05:29:44 +00:00
Update function which split some report values into arrays. More views for pie charts.
This commit is contained in:
parent
6f0d2b6cfb
commit
4d027b4725
1
.ericaignore
Normal file
1
.ericaignore
Normal file
@ -0,0 +1 @@
|
||||
[".idea"]
|
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
.idea
|
||||
|
59
updates/report.js
Normal file
59
updates/report.js
Normal file
@ -0,0 +1,59 @@
|
||||
/**
|
||||
* Inserts a reception timestamp and transforms some multiple values fields into arrays.
|
||||
**/
|
||||
function(doc,req) {
|
||||
var data = JSON.parse(req.body);
|
||||
data.timestamp = new Date();
|
||||
data.user_ip = req.peer;
|
||||
data["_id"] = data.REPORT_ID;
|
||||
if(data.STACK_TRACE) {
|
||||
data.STACK_TRACE = data.STACK_TRACE.split('\n');
|
||||
}
|
||||
|
||||
if(data.LOGCAT) {
|
||||
data.LOGCAT = data.LOGCAT.split('\n');
|
||||
}
|
||||
if(data.RADIOLOG) {
|
||||
data.RADIOLOG = data.RADIOLOG.split('\n');
|
||||
}
|
||||
if(data.EVENTSLOG) {
|
||||
data.EVENTSLOG = data.EVENTSLOG.split('\n');
|
||||
}
|
||||
if(data.SETTINGS_SECURE.ENABLED_INPUT_METHODS) {
|
||||
data.SETTINGS_SECURE.ENABLED_INPUT_METHODS = data.SETTINGS_SECURE.ENABLED_INPUT_METHODS.split(':');
|
||||
}
|
||||
if(data.SETTINGS_SYSTEM.AIRPLANE_MODE_RADIOS) {
|
||||
data.SETTINGS_SYSTEM.AIRPLANE_MODE_RADIOS = data.SETTINGS_SYSTEM.AIRPLANE_MODE_RADIOS.split(',');
|
||||
}
|
||||
if(data.SETTINGS_GLOBAL.AIRPLANE_MODE_RADIOS) {
|
||||
data.SETTINGS_GLOBAL.AIRPLANE_MODE_RADIOS = data.SETTINGS_GLOBAL.AIRPLANE_MODE_RADIOS.split(',');
|
||||
}
|
||||
if(data.SETTINGS_GLOBAL.AIRPLANE_MODE_TOGGLEABLE_RADIOS) {
|
||||
data.SETTINGS_GLOBAL.AIRPLANE_MODE_TOGGLEABLE_RADIOS = data.SETTINGS_GLOBAL.AIRPLANE_MODE_TOGGLEABLE_RADIOS.split(',');
|
||||
}
|
||||
if(data.INITIAL_CONFIGURATION.screenLayout) {
|
||||
data.INITIAL_CONFIGURATION.screenLayout = data.INITIAL_CONFIGURATION.screenLayout.split('+');
|
||||
}
|
||||
if(data.INITIAL_CONFIGURATION.uiMode) {
|
||||
data.INITIAL_CONFIGURATION.uiMode = data.INITIAL_CONFIGURATION.uiMode.split('+');
|
||||
}
|
||||
if(data.CRASH_CONFIGURATION.screenLayout) {
|
||||
data.CRASH_CONFIGURATION.screenLayout = data.CRASH_CONFIGURATION.screenLayout.split('+');
|
||||
}
|
||||
if(data.CRASH_CONFIGURATION.uiMode) {
|
||||
data.CRASH_CONFIGURATION.uiMode = data.CRASH_CONFIGURATION.uiMode.split('+');
|
||||
}
|
||||
// This causes Error 500...
|
||||
/* if(data.DISPLAY) {
|
||||
data.DISPLAY.forEach( function(d) {
|
||||
if(d.flags){
|
||||
d.flags = d.flags.split('+');
|
||||
}
|
||||
});
|
||||
}
|
||||
*/
|
||||
|
||||
data.requestHeaders = req.headers;
|
||||
message = "OK";
|
||||
return [ data, message];
|
||||
}
|
5
views/reports-per-android-sdk-version/map.js
Normal file
5
views/reports-per-android-sdk-version/map.js
Normal file
@ -0,0 +1,5 @@
|
||||
function(doc) {
|
||||
if(doc.BUILD.VERSION.SDK) {
|
||||
emit(doc.BUILD.VERSION.SDK, 1);
|
||||
}
|
||||
}
|
3
views/reports-per-android-sdk-version/reduce.js
Normal file
3
views/reports-per-android-sdk-version/reduce.js
Normal file
@ -0,0 +1,3 @@
|
||||
function(keys, values, rereduce) {
|
||||
return sum(values);
|
||||
}
|
5
views/reports-per-android-version/map.js
Normal file
5
views/reports-per-android-version/map.js
Normal file
@ -0,0 +1,5 @@
|
||||
function(doc) {
|
||||
if(doc.ANDROID_VERSION) {
|
||||
emit(doc.ANDROID_VERSION, 1);
|
||||
}
|
||||
}
|
3
views/reports-per-android-version/reduce.js
Normal file
3
views/reports-per-android-version/reduce.js
Normal file
@ -0,0 +1,3 @@
|
||||
function(keys, values, rereduce) {
|
||||
return sum(values);
|
||||
}
|
5
views/reports-per-app-version-code/map.js
Normal file
5
views/reports-per-app-version-code/map.js
Normal file
@ -0,0 +1,5 @@
|
||||
function(doc) {
|
||||
if(doc.APP_VERSION_CODE) {
|
||||
emit(doc.APP_VERSION_CODE, 1);
|
||||
}
|
||||
}
|
3
views/reports-per-app-version-code/reduce.js
Normal file
3
views/reports-per-app-version-code/reduce.js
Normal file
@ -0,0 +1,3 @@
|
||||
function(keys, values, rereduce) {
|
||||
return sum(values);
|
||||
}
|
5
views/reports-per-app-version-name/map.js
Normal file
5
views/reports-per-app-version-name/map.js
Normal file
@ -0,0 +1,5 @@
|
||||
function(doc) {
|
||||
if(doc.APP_VERSION_NAME) {
|
||||
emit(doc.APP_VERSION_NAME, 1);
|
||||
}
|
||||
}
|
3
views/reports-per-app-version-name/reduce.js
Normal file
3
views/reports-per-app-version-name/reduce.js
Normal file
@ -0,0 +1,3 @@
|
||||
function(keys, values, rereduce) {
|
||||
return sum(values);
|
||||
}
|
@ -2,7 +2,7 @@ function(doc) {
|
||||
if(doc.USER_CRASH_DATE) {
|
||||
var crashDate = new Date(doc.USER_CRASH_DATE);
|
||||
if(crashDate.getFullYear() > 2000) {
|
||||
emit([crashDate.getFullYear(), crashDate.getMonth() , crashDate.getDate()], 1);
|
||||
emit([crashDate.getFullYear(), crashDate.getMonth() , crashDate.getDate(), crashDate.getHours(), crashDate.getMinutes(), crashDate.getSeconds(), crashDate.getMilliseconds()], 1);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user