Added explicit timeout for data base connection and increased width

of download graph.
This commit is contained in:
Achim D. Brucker 2018-07-31 23:03:20 +01:00
parent 1c42ff951d
commit 4145ace1d2
1 changed files with 4 additions and 3 deletions

View File

@ -31,7 +31,7 @@ open XPlot.GoogleCharts.Deedle
// the connection string shall be of the form
// "Server=<DBHOST>;Database=extensions;User=<USER>;Password=<PASSWORD>"
let ctx = ExtensionDbProvider.GetDataContext(connectionStringOrDefault "")
let ctx = ExtensionDbProvider.GetDataContext(connectionStringOrDefault "",commandTimeout=36000)
// Log SQL: https://fsprojects.github.io/SQLProvider/core/querying.html
FSharp.Data.Sql.Common.QueryEvents.SqlQueryEvent |> Event.add (printfn "Executing SQL: %O")
@ -39,11 +39,11 @@ FSharp.Data.Sql.Common.QueryEvents.SqlQueryEvent |> Event.add (printfn "Executin
let chartDownloads extIds = (List.map (fun e -> (series (getDownloads ctx e))) extIds)
|> Chart.Line
|> Chart.WithOptions (Options(legend=Legend(position="bottom")))
|> Chart.WithOptions (Options(legend=Legend(position="bottom"), width=1100))
|> Chart.WithLabels extIds
chartDownloads ["lkllajgbhondgjjnhmmgbjndmogapinp"]
// chartDownloads (List.take 5 (getAllExtIds ctx))
// chartDownloads (List.take 5 (getAllExtIds ctx |> Seq.toList))
let extData =
query {for x in ctx.Extensions.Extension do
@ -52,3 +52,4 @@ let extData =
|> Seq.map (fun (date, name, download) -> (date, name.Value, download.Value))
|> Frame.ofRecords
|> Frame.indexColsWith ["Date"; "Name"; "Downloads"]