diff --git a/backend/goserver/goserver b/backend/goserver/goserver
index 736275f..be02728 100755
Binary files a/backend/goserver/goserver and b/backend/goserver/goserver differ
diff --git a/backend/goserver/list_appversions_generated.txt b/backend/goserver/list_appversions_generated.txt
new file mode 100644
index 0000000..66b22d8
--- /dev/null
+++ b/backend/goserver/list_appversions_generated.txt
@@ -0,0 +1,5 @@
+4.0.0-pre-alpha (git cad6fd7)
+4.0.0-pre-alpha (git 04ea6ca)
+4.0.0-pre-alpha (git b287399)
+4.0.0-pre-alpha (git 9a24b51)
+4.0.0-pre-alpha
diff --git a/backend/goserver/main.go b/backend/goserver/main.go
index f3b842a..15dd62b 100644
--- a/backend/goserver/main.go
+++ b/backend/goserver/main.go
@@ -1,158 +1,165 @@
package main
import (
"fmt"
"io/ioutil"
serv "kritaServers/backend/goserver/server"
agr "kritaServers/backend/goserver/server/agregate"
"net/http"
"time"
)
type ColorGroup struct {
ID int
Name string
Colors []string
}
func handlerInstall(w http.ResponseWriter, r *http.Request) {
fmt.Printf("handlerInstall!")
bodyBuffer, _ := ioutil.ReadAll(r.Body)
// fmt.Printf("after parse")
fmt.Println(string(bodyBuffer))
serv.InsertGeneralInfo(bodyBuffer)
w.Header().Set("Server", "A Go Web Server")
w.WriteHeader(200)
}
func handlerTools(w http.ResponseWriter, r *http.Request) {
fmt.Printf("handlerTools!")
bodyBuffer, _ := ioutil.ReadAll(r.Body)
- fmt.Println(string(bodyBuffer))
+ //fmt.Println(string(bodyBuffer))
serv.InsertToolInfo(bodyBuffer)
w.Header().Set("Server", "A Go Web Server")
w.WriteHeader(200)
}
func handlerImageProperties(w http.ResponseWriter, r *http.Request) {
fmt.Printf("handlerImageProperties!")
bodyBuffer, _ := ioutil.ReadAll(r.Body)
- fmt.Println(string(bodyBuffer))
+ //fmt.Println(string(bodyBuffer))
serv.InsertImageInfo(bodyBuffer)
}
func handlerAsserts(w http.ResponseWriter, r *http.Request) {
bodyBuffer, _ := ioutil.ReadAll(r.Body)
- fmt.Printf("Asserts")
+ fmt.Printf("\nAsserts!")
fmt.Println(string(bodyBuffer))
serv.InsertAssertInfo(bodyBuffer)
w.Header().Set("Server", "A Go Web Server")
w.WriteHeader(200)
}
func handlerActions(w http.ResponseWriter, r *http.Request) {
fmt.Printf("handlerActions!")
bodyBuffer, _ := ioutil.ReadAll(r.Body)
- fmt.Println(string(bodyBuffer))
+ // fmt.Println(string(bodyBuffer))
serv.InsertActionInfo(bodyBuffer)
w.Header().Set("Server", "A Go Web Server")
w.WriteHeader(200)
}
func handlerGetTools(w http.ResponseWriter, r *http.Request) {
temp := agr.Agregated("tools")
fmt.Fprintf(w, temp)
}
func handlerGetActions(w http.ResponseWriter, r *http.Request) {
temp := agr.Agregated("actions")
fmt.Fprintf(w, temp)
}
func handlerGetInstallInfo(w http.ResponseWriter, r *http.Request) {
type1 := r.URL.Query().Get("type")
+
fmt.Println("Install!")
if len(type1) != 0 {
dataOfType := agr.AgregatedInstall(type1)
fmt.Fprintf(w, dataOfType)
fmt.Println(dataOfType)
return
}
temp := agr.Agregated("install")
- fmt.Println(temp)
fmt.Fprintf(w, temp)
}
func handlerGetImageInfo(w http.ResponseWriter, r *http.Request) {
type1 := r.URL.Query().Get("type")
if len(type1) != 0 {
dataOfType := agr.AgregatedImages(type1)
fmt.Fprintf(w, dataOfType)
return
}
temp := agr.Agregated("images")
fmt.Fprintf(w, temp)
}
func handlerGetAssertsInfo(w http.ResponseWriter, r *http.Request) {
temp := agr.Agregated("asserts")
fmt.Fprintf(w, temp)
}
func main() {
fmt.Printf("hello")
serv.InitDB()
defer serv.Session.Close()
http.HandleFunc("/install/receiver/submit/org.krita.krita", handlerInstall)
http.HandleFunc("/tools/receiver/submit/org.krita.krita", handlerTools)
http.HandleFunc("/imageProperties/receiver/submit/org.krita.krita", handlerImageProperties)
http.HandleFunc("/asserts/receiver/submit/org.krita.krita", handlerAsserts)
http.HandleFunc("/actions/receiver/submit/org.krita.krita", handlerActions)
http.HandleFunc("/GoogleLogin", serv.HandleGoogleLogin)
http.HandleFunc("/GoogleCallback", serv.HandleGoogleCallback)
http.HandleFunc("/get/tools", handlerGetTools)
http.HandleFunc("/get/actions", handlerGetActions)
http.HandleFunc("/get/install", handlerGetInstallInfo)
http.HandleFunc("/get/images", handlerGetImageInfo)
http.HandleFunc("/get/asserts", handlerGetAssertsInfo)
ticker := time.NewTicker(time.Minute * 2)
tickerActions := time.NewTicker(time.Minute * 3)
tickerTools := time.NewTicker(time.Minute * 3)
tickerImages := time.NewTicker(time.Minute * 4)
tickerAsserts := time.NewTicker(time.Minute * 2)
+ tickerGenerateLists := time.NewTicker(time.Hour * 10)
go func() {
for _ = range ticker.C {
agr.AgregateInstalInfo()
// fmt.Println("Tick at", t)
}
}()
go func() {
for _ = range tickerActions.C {
agr.AgregateActions()
//fmt.Println("Tick actions at", t)
}
}()
go func() {
for _ = range tickerTools.C {
agr.AgregateTools()
// fmt.Println("Tick tools at", t)
}
}()
go func() {
for _ = range tickerImages.C {
agr.AgregateImageProps()
//fmt.Println("Tick image at", t)
}
}()
go func() {
for _ = range tickerAsserts.C {
agr.AgregateAsserts()
//fmt.Println("Tick asserts")
}
}()
+
+ go func() {
+ for _ = range tickerGenerateLists.C {
+ agr.AgregateListAppVersions()
+ }
+ }()
http.ListenAndServe(":8080", nil)
}
diff --git a/backend/goserver/server/agregate/installInfo.go b/backend/goserver/server/agregate/installInfo.go
index d45813b..d31ccaf 100644
--- a/backend/goserver/server/agregate/installInfo.go
+++ b/backend/goserver/server/agregate/installInfo.go
@@ -1,138 +1,190 @@
package agregate
import (
+ "bufio"
+ "fmt"
serv "kritaServers/backend/goserver/server"
+ md "kritaServers/backend/goserver/server/models"
+ "os"
+ mgo "gopkg.in/mgo.v2"
"gopkg.in/mgo.v2/bson"
)
func AgregateInstalInfo() {
c := serv.Session.DB("telemetry").C("installInfo")
//Some error takes place. We lose a little bit of data
countRecords := getFloat64(c.Find(bson.M{}).Count())
//compiler
agreagtedData.Compiler.Type.GCC.Count = getFloat64(c.Find(bson.M{"compiler.type": "GCC"}).Count())
agreagtedData.Compiler.Type.Clang.Count = getFloat64(c.Find(bson.M{"compiler.type": "Clang"}).Count())
agreagtedData.Compiler.Type.MSVC.Count = getFloat64(c.Find(bson.M{"compiler.type": "MSVC"}).Count())
existsRecords := countExist("compiler.type", c)
agreagtedData.Compiler.Type.Other.Count = existsRecords - agreagtedData.Compiler.Type.GCC.Count - agreagtedData.Compiler.Type.Clang.Count - agreagtedData.Compiler.Type.MSVC.Count
agreagtedData.Compiler.Type.Other.Count = checkOtherCount(agreagtedData.Compiler.Type.Other.Count)
agreagtedData.Compiler.Type.Unknown.Count = countRecords - existsRecords
agreagtedData.Compiler.Type.GCC.Proportion = getProportion(agreagtedData.Compiler.Type.GCC.Count, existsRecords)
agreagtedData.Compiler.Type.Clang.Proportion = getProportion(agreagtedData.Compiler.Type.Clang.Count, existsRecords)
agreagtedData.Compiler.Type.MSVC.Proportion = getProportion(agreagtedData.Compiler.Type.MSVC.Count, existsRecords)
agreagtedData.Compiler.Type.Other.Proportion = getProportion(agreagtedData.Compiler.Type.Other.Count, existsRecords)
//os
agreagtedData.Platform.Os.Linux.Count = getFloat64(c.Find(bson.M{"platform.os": "linux"}).Count())
agreagtedData.Platform.Os.Windows.Count = getFloat64(c.Find(bson.M{"platform.os": "windows"}).Count())
agreagtedData.Platform.Os.Mac.Count = getFloat64(c.Find(bson.M{"platform.os": "mac"}).Count())
existsRecords = countExist("platform.os", c)
agreagtedData.Platform.Os.Other.Count = existsRecords - agreagtedData.Platform.Os.Linux.Count - agreagtedData.Platform.Os.Windows.Count - agreagtedData.Platform.Os.Mac.Count
agreagtedData.Platform.Os.Other.Count = checkOtherCount(agreagtedData.Platform.Os.Other.Count)
agreagtedData.Platform.Os.Unknown.Count = countRecords - existsRecords
agreagtedData.Platform.Os.Linux.Proportion = getProportion(agreagtedData.Platform.Os.Linux.Count, existsRecords)
agreagtedData.Platform.Os.Windows.Proportion = getProportion(agreagtedData.Platform.Os.Windows.Count, existsRecords)
agreagtedData.Platform.Os.Mac.Proportion = getProportion(agreagtedData.Platform.Os.Mac.Count, existsRecords)
agreagtedData.Platform.Os.Other.Proportion = getProportion(agreagtedData.Platform.Os.Other.Count, existsRecords)
agreagtedData.Platform.Os.Unknown.Proportion = getProportion(agreagtedData.Platform.Os.Unknown.Count, existsRecords)
//version os windows
agreagtedData.Platform.Version.Windows.V7.Count = getFloat64(c.Find(bson.M{"platform.version": "7"}).Count())
agreagtedData.Platform.Version.Windows.V8.Count = getFloat64(c.Find(bson.M{"platform.version": "8"}).Count())
agreagtedData.Platform.Version.Windows.V81.Count = getFloat64(c.Find(bson.M{"platform.version": "8.1"}).Count())
agreagtedData.Platform.Version.Windows.V10.Count = getFloat64(c.Find(bson.M{"platform.version": "10"}).Count())
agreagtedData.Platform.Version.Windows.Other.Count = agreagtedData.Platform.Os.Windows.Count - agreagtedData.Platform.Version.Windows.V7.Count - agreagtedData.Platform.Version.Windows.V8.Count - agreagtedData.Platform.Version.Windows.V81.Count - agreagtedData.Platform.Version.Windows.V10.Count
agreagtedData.Platform.Version.Windows.Other.Count = checkOtherCount(agreagtedData.Platform.Version.Windows.Other.Count)
agreagtedData.Platform.Version.Windows.V7.Proportion = getProportion(agreagtedData.Platform.Version.Windows.V7.Count, agreagtedData.Platform.Os.Windows.Count)
agreagtedData.Platform.Version.Windows.V8.Proportion = getProportion(agreagtedData.Platform.Version.Windows.V8.Count, agreagtedData.Platform.Os.Windows.Count)
agreagtedData.Platform.Version.Windows.V81.Proportion = getProportion(agreagtedData.Platform.Version.Windows.V81.Count, agreagtedData.Platform.Os.Windows.Count)
agreagtedData.Platform.Version.Windows.V10.Proportion = getProportion(agreagtedData.Platform.Version.Windows.V10.Count, agreagtedData.Platform.Os.Windows.Count)
agreagtedData.Platform.Version.Windows.Other.Proportion = getProportion(agreagtedData.Platform.Version.Windows.Other.Count, agreagtedData.Platform.Os.Windows.Count)
//version os linux
//не уверен, что именно так пишется нужные версии linux
agreagtedData.Platform.Version.Linux.Ubuntu1404.Count = getFloat64(c.Find(bson.M{"platform.version": "ubuntu-14.04"}).Count())
agreagtedData.Platform.Version.Linux.Ubuntu1410.Count = getFloat64(c.Find(bson.M{"platform.version": "ubuntu-14.10"}).Count())
agreagtedData.Platform.Version.Linux.Ubuntu1504.Count = getFloat64(c.Find(bson.M{"platform.version": "ubuntu-15.04"}).Count())
agreagtedData.Platform.Version.Linux.Ubuntu1510.Count = getFloat64(c.Find(bson.M{"platform.version": "ubuntu-15.10"}).Count())
agreagtedData.Platform.Version.Linux.Ubuntu1604.Count = getFloat64(c.Find(bson.M{"platform.version": "ubuntu-16.04"}).Count())
agreagtedData.Platform.Version.Linux.Other.Count = agreagtedData.Platform.Os.Linux.Count - agreagtedData.Platform.Version.Linux.Ubuntu1404.Count - agreagtedData.Platform.Version.Linux.Ubuntu1410.Count - agreagtedData.Platform.Version.Linux.Ubuntu1504.Count - agreagtedData.Platform.Version.Linux.Ubuntu1510.Count - agreagtedData.Platform.Version.Linux.Ubuntu1604.Count - agreagtedData.Platform.Version.Linux.Ubuntu1610.Count - agreagtedData.Platform.Version.Linux.Ubuntu1704.Count
agreagtedData.Platform.Version.Linux.Other.Count = checkOtherCount(agreagtedData.Platform.Version.Linux.Other.Count)
agreagtedData.Platform.Version.Linux.Ubuntu1404.Proportion = getProportion(agreagtedData.Platform.Version.Linux.Ubuntu1404.Count, agreagtedData.Platform.Os.Linux.Count)
agreagtedData.Platform.Version.Linux.Ubuntu1410.Proportion = getProportion(agreagtedData.Platform.Version.Linux.Ubuntu1410.Count, agreagtedData.Platform.Os.Linux.Count)
agreagtedData.Platform.Version.Linux.Ubuntu1504.Proportion = getProportion(agreagtedData.Platform.Version.Linux.Ubuntu1504.Count, agreagtedData.Platform.Os.Linux.Count)
agreagtedData.Platform.Version.Linux.Ubuntu1510.Proportion = getProportion(agreagtedData.Platform.Version.Linux.Ubuntu1510.Count, agreagtedData.Platform.Os.Linux.Count)
agreagtedData.Platform.Version.Linux.Ubuntu1604.Proportion = getProportion(agreagtedData.Platform.Version.Linux.Ubuntu1604.Count, agreagtedData.Platform.Os.Linux.Count)
agreagtedData.Platform.Version.Linux.Ubuntu1610.Proportion = getProportion(agreagtedData.Platform.Version.Linux.Ubuntu1610.Count, agreagtedData.Platform.Os.Linux.Count)
agreagtedData.Platform.Version.Linux.Ubuntu1704.Proportion = getProportion(agreagtedData.Platform.Version.Linux.Ubuntu1704.Count, agreagtedData.Platform.Os.Linux.Count)
agreagtedData.Platform.Version.Linux.Other.Proportion = getProportion(agreagtedData.Platform.Version.Linux.Other.Count, agreagtedData.Platform.Os.Linux.Count)
//mac version
agreagtedData.Platform.Version.Mac.V1012.Count = getFloat64(c.Find(bson.M{"platform.version": "10.12"}).Count())
agreagtedData.Platform.Version.Mac.Other.Count = agreagtedData.Platform.Os.Mac.Count - agreagtedData.Platform.Version.Mac.V1012.Count
agreagtedData.Platform.Version.Mac.Other.Count = checkOtherCount(agreagtedData.Platform.Version.Linux.Other.Count)
agreagtedData.Platform.Version.Mac.V1012.Proportion = getProportion(agreagtedData.Platform.Version.Mac.V1012.Count, agreagtedData.Platform.Os.Linux.Count)
agreagtedData.Platform.Version.Mac.Other.Proportion = getProportion(agreagtedData.Platform.Version.Mac.Other.Count, agreagtedData.Platform.Os.Linux.Count)
//cpu
agreagtedData.CPU.Architecture.X86_64.Count = getFloat64(c.Find(bson.M{"cpu.architecture": "x86_64"}).Count())
agreagtedData.CPU.Architecture.X86.Count = getFloat64(c.Find(bson.M{"cpu.architecture": "i386"}).Count())
existsRecords = countExist("cpu.architecture", c)
agreagtedData.CPU.Architecture.Other.Count = existsRecords - agreagtedData.CPU.Architecture.X86_64.Count - agreagtedData.CPU.Architecture.X86.Count
agreagtedData.CPU.Architecture.Other.Count = checkOtherCount(agreagtedData.CPU.Architecture.Other.Count)
agreagtedData.CPU.Architecture.Unknown.Count = countRecords - existsRecords
agreagtedData.CPU.Architecture.X86_64.Proportion = getProportion(agreagtedData.CPU.Architecture.X86_64.Count, existsRecords)
agreagtedData.CPU.Architecture.X86.Proportion = getProportion(agreagtedData.CPU.Architecture.X86.Count, existsRecords)
agreagtedData.CPU.Architecture.Other.Proportion = getProportion(agreagtedData.CPU.Architecture.Other.Count, existsRecords)
agreagtedData.CPU.Architecture.Unknown.Proportion = getProportion(agreagtedData.CPU.Architecture.Unknown.Count, countRecords)
//cpu cores
agreagtedData.CPU.Cores.C1.Count = getFloat64(c.Find(bson.M{"cpu.count": 1}).Count())
agreagtedData.CPU.Cores.C2.Count = getFloat64(c.Find(bson.M{"cpu.count": 2}).Count())
agreagtedData.CPU.Cores.C3.Count = getFloat64(c.Find(bson.M{"cpu.count": 3}).Count())
agreagtedData.CPU.Cores.C4.Count = getFloat64(c.Find(bson.M{"cpu.count": 4}).Count())
agreagtedData.CPU.Cores.C6.Count = getFloat64(c.Find(bson.M{"cpu.count": 6}).Count())
agreagtedData.CPU.Cores.C8.Count = getFloat64(c.Find(bson.M{"cpu.count": 8}).Count())
existsRecords = countExist("cpu.count", c)
agreagtedData.CPU.Cores.Other.Count = existsRecords - agreagtedData.CPU.Cores.C1.Count - agreagtedData.CPU.Cores.C2.Count - agreagtedData.CPU.Cores.C3.Count - agreagtedData.CPU.Cores.C4.Count - agreagtedData.CPU.Cores.C6.Count - agreagtedData.CPU.Cores.C8.Count
agreagtedData.CPU.Cores.Unknown.Count = countRecords - existsRecords
agreagtedData.CPU.Cores.C1.Proportion = getProportion(agreagtedData.CPU.Cores.C1.Count, existsRecords)
agreagtedData.CPU.Cores.C2.Proportion = getProportion(agreagtedData.CPU.Cores.C2.Count, existsRecords)
agreagtedData.CPU.Cores.C3.Proportion = getProportion(agreagtedData.CPU.Cores.C3.Count, existsRecords)
agreagtedData.CPU.Cores.C4.Proportion = getProportion(agreagtedData.CPU.Cores.C4.Count, existsRecords)
agreagtedData.CPU.Cores.C6.Proportion = getProportion(agreagtedData.CPU.Cores.C6.Count, existsRecords)
agreagtedData.CPU.Cores.C8.Proportion = getProportion(agreagtedData.CPU.Cores.C8.Count, existsRecords)
agreagtedData.CPU.Cores.Other.Proportion = getProportion(agreagtedData.CPU.Cores.Other.Count, existsRecords)
agreagtedData.CPU.Cores.Unknown.Proportion = getProportion(agreagtedData.CPU.Cores.Unknown.Count, countRecords)
agreagtedData.CPU.Vendor.Intel.Count = getFloat64(c.Find(bson.M{"cpu.isintel": true}).Count())
existsRecords = countExist("cpu.isintel", c)
agreagtedData.CPU.Vendor.Other.Count = existsRecords - agreagtedData.CPU.Vendor.Intel.Count
agreagtedData.CPU.Vendor.Unknown.Count = countRecords - existsRecords
agreagtedData.CPU.Vendor.Intel.Proportion = getProportion(agreagtedData.CPU.Vendor.Intel.Count, existsRecords)
agreagtedData.CPU.Vendor.Other.Proportion = getProportion(agreagtedData.CPU.Vendor.Other.Count, existsRecords)
agreagtedData.CPU.Vendor.Unknown.Proportion = getProportion(agreagtedData.CPU.Vendor.Unknown.Count, countRecords)
//language
agreagtedData.Locale.Language.English.Count = getFloat64(c.Find(bson.M{"locale.language": "English"}).Count())
agreagtedData.Locale.Language.Russian.Count = getFloat64(c.Find(bson.M{"locale.language": "Russian"}).Count())
existsRecords = countExist("locale.language", c)
agreagtedData.Locale.Language.Other.Count = existsRecords - agreagtedData.Locale.Language.English.Count - agreagtedData.Locale.Language.Russian.Count
agreagtedData.Locale.Language.Other.Count = checkOtherCount(agreagtedData.Locale.Language.Other.Count)
agreagtedData.Locale.Language.Unknown.Count = countRecords - existsRecords
agreagtedData.Locale.Language.English.Proportion = getProportion(agreagtedData.Locale.Language.English.Count, existsRecords)
agreagtedData.Locale.Language.Russian.Proportion = getProportion(agreagtedData.Locale.Language.Russian.Count, existsRecords)
agreagtedData.Locale.Language.Other.Proportion = getProportion(agreagtedData.Locale.Language.Other.Count, existsRecords)
agreagtedData.Locale.Language.Unknown.Proportion = getProportion(agreagtedData.Locale.Language.Unknown.Count, countRecords)
+ agregateAppVersions(c, countRecords)
+}
+func AgregateListAppVersions() {
+ c := serv.Session.DB("telemetry").C("installInfo")
+ var versions []string
+ err := c.Find(nil).Distinct("general.appversion", &versions)
+ serv.CheckErr(err)
+ file, err := os.Create("list_appversions_generated.txt")
+ serv.CheckErr(err)
+ defer file.Close()
+ w := bufio.NewWriter(file)
+ for _, version := range versions {
+ if version != "" {
+ fmt.Fprintln(w, version)
+ }
+ }
+ err = w.Flush()
+ serv.CheckErr(err)
+}
+
+func agregateAppVersions(c *mgo.Collection, countRecords float64) {
+ file, err := os.Open("list_appversions_generated.txt")
+ serv.CheckErr(err)
+ defer file.Close()
+ existsRecords := countExist("general.appversion", c)
+
+ var version md.AppVersion
+ var versions []md.AppVersion
+
+ scanner := bufio.NewScanner(file)
+ for scanner.Scan() {
+ version.Name = scanner.Text()
+ version.CountUse.Count = getFloat64(c.Find(bson.M{"general.appversion": version.Name}).Count())
+ version.CountUse.Proportion = getProportion(version.CountUse.Count, existsRecords)
+ versions = append(versions, version)
+ }
+ err = scanner.Err()
+ serv.CheckErr(err)
+ var sumVersions float64
+ for _, version := range versions {
+ sumVersions += version.CountUse.Count
+ }
+ agreagtedData.AppVersions.Versions = versions
+ agreagtedData.AppVersions.Other.Count = existsRecords - sumVersions
+ agreagtedData.AppVersions.Unknown.Count = countRecords - existsRecords
+ agreagtedData.AppVersions.Other.Proportion = getProportion(existsRecords, sumVersions)
+ agreagtedData.AppVersions.Unknown.Proportion = getProportion(countRecords, existsRecords)
}
diff --git a/backend/goserver/server/models/assertInfo.go b/backend/goserver/server/models/assertInfo.go
index 976bed3..96624e7 100644
--- a/backend/goserver/server/models/assertInfo.go
+++ b/backend/goserver/server/models/assertInfo.go
@@ -1,10 +1,12 @@
package models
type Assert struct {
- Assert AssertssInternal `json:"asserts"`
+ Asserts []AssertsInternal `json:"asserts"`
}
-type AssertssInternal struct {
- AssertFile string `json:"assertFile"`
- AssertLine string `json:"assertLine"`
- AssertText string `json:"assertText"`
+type AssertsInternal struct {
+ AssertFile string `json:"assertFile"`
+ AssertLine float64 `json:"assertLine"`
+ AssertText string `json:"assertText"`
+ Count float64 `json:"count"`
+ IsFatal bool `json:"isFatal"`
}
diff --git a/backend/goserver/server/models/collectModel.go b/backend/goserver/server/models/collectModel.go
index 04e81f2..7ff28bb 100644
--- a/backend/goserver/server/models/collectModel.go
+++ b/backend/goserver/server/models/collectModel.go
@@ -1,175 +1,186 @@
package models
type ActionCollected struct {
CountUse float64
Name string
}
type AgregatedActionsJson struct {
Actions []ActionCollected
}
type AssertsCollected struct {
Assert struct {
Line string `bson:"assertline"`
Text string `bson:"asserttext"`
File string `bson:"assertfile"`
} `bson:"assert"`
}
type AgregatedAssertsJson struct {
Asserts []AssertsCollected
}
+
type ToolsCollected struct {
CountUse float64
Time float64
Name string
}
type ToolsCollectedData struct {
ToolsUse []ToolsCollected
ToolsActivate []ToolsCollected
}
type CountAndProportion struct {
Count float64
Proportion string
}
+
+type AppVersion struct {
+ Name string
+ CountUse CountAndProportion
+}
type CollectedInstallData struct {
Platform struct {
Os struct {
Windows CountAndProportion
Linux CountAndProportion
Mac CountAndProportion
Other CountAndProportion
Unknown CountAndProportion
}
Version struct {
Windows struct {
V7 CountAndProportion
V8 CountAndProportion
V81 CountAndProportion
V10 CountAndProportion
Other CountAndProportion
}
Linux struct {
Ubuntu1404 CountAndProportion
Ubuntu1410 CountAndProportion
Ubuntu1504 CountAndProportion
Ubuntu1510 CountAndProportion
Ubuntu1604 CountAndProportion
Ubuntu1610 CountAndProportion
Ubuntu1704 CountAndProportion
Other CountAndProportion
}
Mac struct {
V1012 CountAndProportion
Other CountAndProportion
}
}
}
CPU struct {
Architecture struct {
X86_64 CountAndProportion
X86 CountAndProportion //на самом деле x86_64 c маленькой буквы
Other CountAndProportion
Unknown CountAndProportion
}
Cores struct {
C1 CountAndProportion
C2 CountAndProportion
C3 CountAndProportion
C4 CountAndProportion
C6 CountAndProportion
C8 CountAndProportion
Other CountAndProportion
Unknown CountAndProportion
}
Vendor struct {
Intel CountAndProportion
Other CountAndProportion
Unknown CountAndProportion
}
}
Compiler struct {
Type struct {
GCC CountAndProportion
Clang CountAndProportion
MSVC CountAndProportion
Other CountAndProportion
Unknown CountAndProportion
}
// Version struct { //подумать что можно сделать
// V5dot4 float64
// Other float64
// }
}
Locale struct {
Language struct {
English CountAndProportion
Russian CountAndProportion
Other CountAndProportion
Unknown CountAndProportion
}
}
+ AppVersions struct {
+ Versions []AppVersion
+ Other CountAndProportion
+ Unknown CountAndProportion
+ }
}
//Less or equal then mb*
type imageDistribution struct {
Mb1 CountAndProportion
Mb5 CountAndProportion
Mb10 CountAndProportion
Mb25 CountAndProportion
Mb50 CountAndProportion
Mb100 CountAndProportion
Mb200 CountAndProportion
Mb400 CountAndProportion
Mb800 CountAndProportion
More800 CountAndProportion
Unknown CountAndProportion
}
type colorProfileDistribution struct {
RGBA CountAndProportion
CMYK CountAndProportion
Grayscale CountAndProportion
XYZ CountAndProportion
YCbCr CountAndProportion
Lab CountAndProportion
Unknown CountAndProportion
}
//Less then L*
type heightDistribution struct {
L500 CountAndProportion
L1000 CountAndProportion
L2000 CountAndProportion
L4000 CountAndProportion
L8000 CountAndProportion
M8000 CountAndProportion
Unknown CountAndProportion
}
type widthDistribution struct {
L500 CountAndProportion
L1000 CountAndProportion
L2000 CountAndProportion
L4000 CountAndProportion
L8000 CountAndProportion
M8000 CountAndProportion
Unknown CountAndProportion
}
type layersDistribution struct {
L1 CountAndProportion
L2 CountAndProportion
L4 CountAndProportion
L8 CountAndProportion
L16 CountAndProportion
L32 CountAndProportion
L64 CountAndProportion
M64 CountAndProportion
Unknown CountAndProportion
}
type ImageCollected struct {
ID imageDistribution
CPD colorProfileDistribution
HD heightDistribution
WD widthDistribution
LD layersDistribution
//TODO COLORSPACE
}
diff --git a/frontend/treeview/db.sqlite3 b/frontend/treeview/db.sqlite3
index ab519a8..d2c6820 100644
Binary files a/frontend/treeview/db.sqlite3 and b/frontend/treeview/db.sqlite3 differ
diff --git a/frontend/treeview/treeview_app/templates/treeview_app/install_graphs.html b/frontend/treeview/treeview_app/templates/treeview_app/install_graphs.html
index 2d569e8..4b9c1e6 100644
--- a/frontend/treeview/treeview_app/templates/treeview_app/install_graphs.html
+++ b/frontend/treeview/treeview_app/templates/treeview_app/install_graphs.html
@@ -1,15 +1,15 @@
{% extends 'treeview_app/base.html' %}
{% load staticfiles %}
{% block script %}
{% endblock %}
{% block content %}
-{{ chart.as_html }} {{ chart1.as_html }} {{ chart2.as_html }} {{ chart6.as_html }} {{ chart7.as_html }}
+{{ chart.as_html }} {{ chart1.as_html }} {{ chart2.as_html }}{{ chart3.as_html }}{{ chart4.as_html }} {{ chart5.as_html }}{{ chart6.as_html }} {{ chart7.as_html }}
{% endblock %}