Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
CAP
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
tsai
CAP
Commits
15886bd3
Commit
15886bd3
authored
Jun 05, 2018
by
Savorboard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix compilation errors after the upgrade
parent
c0337ae6
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
11 deletions
+19
-11
MySqlMonitoringApi.cs
src/DotNetCore.CAP.MySql/MySqlMonitoringApi.cs
+4
-4
PostgreSqlMonitoringApi.cs
src/DotNetCore.CAP.PostgreSql/PostgreSqlMonitoringApi.cs
+3
-3
SqlServerMonitoringApi.cs
src/DotNetCore.CAP.SqlServer/SqlServerMonitoringApi.cs
+4
-4
TimelineCounter.cs
src/DotNetCore.CAP/Dashboard/TimelineCounter.cs
+8
-0
No files found.
src/DotNetCore.CAP.MySql/MySqlMonitoringApi.cs
View file @
15886bd3
...
...
@@ -126,7 +126,7 @@ select count(Id) from `{0}.received` where StatusName = N'Failed';", _prefix);
{
var
sqlQuery
=
$"select count(Id) from `
{
_prefix
}
.
{
tableName
}
` where StatusName = @state"
;
var
count
=
connection
.
ExecuteScalar
<
int
>(
sqlQuery
,
new
{
state
=
statusName
});
var
count
=
connection
.
ExecuteScalar
<
int
>(
sqlQuery
,
new
{
state
=
statusName
});
return
count
;
}
...
...
@@ -167,10 +167,10 @@ select aggr.* from (
group by date_format(`Added`,'%Y-%m-%d-%H')
) aggr where `Key` in @keys;"
;
var
valuesMap
=
connection
.
Query
(
var
valuesMap
=
connection
.
Query
<
TimelineCounter
>
(
sqlQuery
,
new
{
keys
=
keyMaps
.
Keys
,
statusName
})
.
ToDictionary
(
x
=>
(
string
)
x
.
Key
,
x
=>
(
int
)
x
.
Count
);
new
{
keys
=
keyMaps
.
Keys
,
statusName
})
.
ToDictionary
(
x
=>
x
.
Key
,
x
=>
x
.
Count
);
foreach
(
var
key
in
keyMaps
.
Keys
)
{
...
...
src/DotNetCore.CAP.PostgreSql/PostgreSqlMonitoringApi.cs
View file @
15886bd3
...
...
@@ -128,7 +128,7 @@ select count(""Id"") from ""{0}"".""received"" where ""StatusName"" = N'Failed'
var
sqlQuery
=
$"select count(\"Id\") from \"
{
_options
.
Schema
}
\".\"
{
tableName
}
\" where Lower(\"StatusName\") = Lower(@state)"
;
var
count
=
connection
.
ExecuteScalar
<
int
>(
sqlQuery
,
new
{
state
=
statusName
});
var
count
=
connection
.
ExecuteScalar
<
int
>(
sqlQuery
,
new
{
state
=
statusName
});
return
count
;
}
...
...
@@ -170,9 +170,9 @@ with aggr as (
)
select ""Key"",""Count"" from aggr where ""Key""= Any(@keys);"
;
var
valuesMap
=
connection
.
Query
(
sqlQuery
,
new
{
keys
=
keyMaps
.
Keys
.
ToList
(),
statusName
})
var
valuesMap
=
connection
.
Query
<
TimelineCounter
>(
sqlQuery
,
new
{
keys
=
keyMaps
.
Keys
.
ToList
(),
statusName
})
.
ToList
()
.
ToDictionary
(
x
=>
(
string
)
x
.
Key
,
x
=>
(
int
)
x
.
Count
);
.
ToDictionary
(
x
=>
x
.
Key
,
x
=>
x
.
Count
);
foreach
(
var
key
in
keyMaps
.
Keys
)
{
...
...
src/DotNetCore.CAP.SqlServer/SqlServerMonitoringApi.cs
View file @
15886bd3
...
...
@@ -128,7 +128,7 @@ select count(Id) from [{0}].Received with (nolock) where StatusName = N'Failed';
var
sqlQuery
=
$"select count(Id) from [
{
_options
.
Schema
}
].
{
tableName
}
with (nolock) where StatusName = @state"
;
var
count
=
connection
.
ExecuteScalar
<
int
>(
sqlQuery
,
new
{
state
=
statusName
});
var
count
=
connection
.
ExecuteScalar
<
int
>(
sqlQuery
,
new
{
state
=
statusName
});
return
count
;
}
...
...
@@ -171,10 +171,10 @@ with aggr as (
)
select [Key], [Count] from aggr with (nolock) where [Key] in @keys;"
;
var
valuesMap
=
connection
.
Query
(
var
valuesMap
=
connection
.
Query
<
TimelineCounter
>
(
sqlQuery
,
new
{
keys
=
keyMaps
.
Keys
,
statusName
})
.
ToDictionary
(
x
=>
(
string
)
x
.
Key
,
x
=>
(
int
)
x
.
Count
);
new
{
keys
=
keyMaps
.
Keys
,
statusName
})
.
ToDictionary
(
x
=>
x
.
Key
,
x
=>
x
.
Count
);
foreach
(
var
key
in
keyMaps
.
Keys
)
{
...
...
src/DotNetCore.CAP/Dashboard/TimelineCounter.cs
0 → 100644
View file @
15886bd3
namespace
DotNetCore.CAP.Dashboard
{
public
class
TimelineCounter
{
public
string
Key
{
get
;
set
;
}
public
int
Count
{
get
;
set
;
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment