This commit is contained in:
Ilana Kantorov 2017-08-22 11:26:06 +03:00
Родитель 51aaf143bb
Коммит 924137f7a6
4 изменённых файлов: 45 добавлений и 42 удалений

2
client/@types/types.d.ts поставляемый
Просмотреть файл

@ -52,7 +52,7 @@ interface IDashboardConfig extends IDataSourceContainer, IElementsContainer {
*/
category?: string,
/**
* A flag indicates whether the template is featured
* A flag indicates whether the template is featured at the top of the dashboard creation screen
*/
featured?: boolean,
/**

Просмотреть файл

@ -314,9 +314,12 @@ export default class Home extends React.Component<any, IHomeState> {
);
// Dividing templates into categories
// General - All dashboards without any categories
// Features - Dashboards appearing at the top of the creation screen
let categories = { 'General': [], 'Featured': [] };
templates.forEach((tmpl, index) => {
let category = tmpl.category || 'General';
if (tmpl.featured) {
categories['Featured'].push(createCard(tmpl, index));
}
@ -326,13 +329,8 @@ export default class Home extends React.Component<any, IHomeState> {
// Sort templates alphabetically
let sortedCategories = { 'General': categories.General, 'Featured': categories.Featured };
const keys = Object.keys(categories).sort();
for (let i = 0; i < keys.length; i++) {
let key = keys[i];
if (key !== 'Featured') {
sortedCategories[key] = categories[key];
}
}
const keys = Object.keys(categories).filter(category => category !== 'Featured').sort();
keys.forEach(key => sortedCategories[key] = categories[key]);
categories = sortedCategories;
let toolbarActions = [];

Просмотреть файл

@ -46,7 +46,8 @@ export const config: IDashboardConfig = /*return*/ {
return `
where duration > 0 |
summarize avg_duration= round(avg(duration) / 1000, 1) by bin(timestamp, ${granularity}) |
order by timestamp asc `
order by timestamp asc
`
},
format: { type: "timeline", args: { timeField: "timestamp", valueField: "avg_duration" } }
},
@ -54,7 +55,8 @@ export const config: IDashboardConfig = /*return*/ {
query: ({ granularity }) => {
return `
summarize sum = sum(itemCount) by bin(timestamp, ${granularity}), success |
order by timestamp asc `
order by timestamp asc
`
},
format: {
type: "bars",
@ -73,19 +75,20 @@ export const config: IDashboardConfig = /*return*/ {
queries: {
type: {
query: ({ granularity }) => {
return `summarize count = count() by type `
return `summarize count = count() by type
`
},
format: { type: "pie", args: { value: "count", label: "type", maxLength: 20 } }
},
mapActivity: {
query: () => `
extend location=strcat(client_City, ', ', client_CountryOrRegion)
| summarize location_count=count() by location
| extend popup=strcat('<b>', location, '</b><br />', location_count, ' exceptions')`
extend location=strcat(client_City, ', ', client_CountryOrRegion) |
summarize location_count=count() by location |
extend popup=strcat('<b>', location, '</b><br />', location_count, ' exceptions')
`
},
count: {
query: () =>
` summarize count = count() `,
query: () => ` summarize count = count() `,
format: {
type: "scorecard",
args: {
@ -105,9 +108,7 @@ export const config: IDashboardConfig = /*return*/ {
table: "customEvents",
queries: {
usercount: {
query: () =>
`
summarize count = dcount(user_Id) `,
query: () => ` summarize count = dcount(user_Id) `,
format: {
type: "scorecard",
args: {
@ -127,8 +128,7 @@ export const config: IDashboardConfig = /*return*/ {
table: "traces",
queries: {
count: {
query: () =>
` summarize count = count() `,
query: () => ` summarize count = count() `,
format: {
type: "scorecard",
args: {
@ -138,10 +138,11 @@ export const config: IDashboardConfig = /*return*/ {
}
},
top: {
query: () =>
` project timestamp , message |
query: () => `
project timestamp , message |
order by timestamp desc |
take 10 `
take 10
`
}
}
}
@ -157,7 +158,8 @@ export const config: IDashboardConfig = /*return*/ {
query: ({ granularity }) => {
return `
summarize sum = sum(itemCount) by bin(timestamp, ${granularity}), name |
order by timestamp asc `
order by timestamp asc
`
},
format: {
type: "bars",
@ -165,8 +167,7 @@ export const config: IDashboardConfig = /*return*/ {
}
},
count: {
query: () =>
` summarize count = count() `,
query: () => ` summarize count = count() `,
format: {
type: "scorecard",
args: {
@ -176,10 +177,11 @@ export const config: IDashboardConfig = /*return*/ {
}
},
top: {
query: () =>
` project timestamp , target, data |
query: () => `
project timestamp , target, data |
order by timestamp desc |
take 10 `
take 10
`
}
}
}
@ -400,10 +402,10 @@ export const config: IDashboardConfig = /*return*/ {
dependencies: { queryTimespan: "dialog_errors:queryspan" },
params: {
query: () => `
exceptions
| summarize error_count=count() by type, innermostMessage
| project type, innermostMessage, error_count
| order by error_count desc `
exceptions |
summarize error_count=count() by type, innermostMessage |
project type, innermostMessage, error_count |
order by error_count desc `
}
},
{
@ -416,10 +418,11 @@ export const config: IDashboardConfig = /*return*/ {
},
params: {
query: ({ type, innermostMessage }) => `
exceptions
| where type == '${type}'
| where innermostMessage == "${innermostMessage}"
| project type, innermostMessage, handledAt, operation_Id `
exceptions |
where type == '${type}' |
where innermostMessage == "${innermostMessage}" |
project type, innermostMessage, handledAt, operation_Id
`
}
}
],
@ -475,9 +478,10 @@ export const config: IDashboardConfig = /*return*/ {
dependencies: { operation_Id: "dialog_errordetail:operation_Id", queryTimespan: "dialog_errordetail:queryspan" },
params: {
query: ({ operation_Id }) => `
exceptions
| where operation_Id == '${operation_Id}'
| project handledAt, type, innermostMessage, operation_Id, timestamp, details `
exceptions |
where operation_Id == '${operation_Id}' |
project handledAt, type, innermostMessage, operation_Id, timestamp, details
`
}
}
],

Просмотреть файл

@ -45,7 +45,8 @@ export const config: IDashboardConfig = /*return*/ {
query: ({ granularity }) => {
return `
summarize count= count() by bin(timestamp, ${granularity}) |
order by timestamp asc `
order by timestamp asc
`
},
format: { type: "timeline", args: { timeField: "timestamp", valueField: "count" } }
},