Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TASK] improve output (filtering, fix links type, new outputs nodelist for freifunkapi and meshviewer-ffrgb v10 NextGen) #63

Merged
merged 2 commits into from
Nov 1, 2017

Conversation

genofire
Copy link
Member

@genofire genofire commented May 20, 2017

should fix also

Copy link
Member

@corny corny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warum akzeptieren die filter* Funktionen einen nil-Parameter und warum geben sie etwas anderes als bool zurück? Bitte überdenken!

xA float64
xB float64
yA float64
yB float64
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wieso unterschiedliche Bezeichnungen? Hier x und y und dort latitude und longitude?
Vier Punkte in einem zweidimenionalen Raum können was ganz anderes sein....

return node
}
} else {
if location := nodeinfo.Location; location == nil {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bitte entschachteln

return nil
}

func filterLocationInArea(node *runtime.Node, a area) *runtime.Node {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warum sollte nil an diese Funktion übergeben werden?

for outputType, outputRegister := range output.Adapters {
outputConfigs, ok := allOutputs[outputType].([]map[string]interface{})
if !ok {
continue
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Einfach ignorieren, wenn nicht ok ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Du meinst man sollte erst aus der map lesen und dann den Objekttypen wandlen ( wobei dann ein panic geworfen wird?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Die Frage ist: Erwartet ein Anwender von Yanic, dass eine fehlerhafte Konfiguration stillschweigend akzeptiert wird? Was ist hilfreich?

filteredNodes := nodes
if config, ok := o.filter[i]; ok {
filteredNodes = config.filtering(nodes)
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

was wenn nicht ok?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UPS, ist mir auch noch gestern eingefalleeingefallen, das dann der owner nicht standartdmäßig weggefilter wird.


Close()

time.Sleep(time.Millisecond * 12) // to reach timer.Stop() line
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hier brauchst du nicht schlafen, wenn du WaitGroups benutzt.


func Register(configuration map[string]interface{}) (output.Output, error) {
var config Config
config = configuration
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

weshalb struct kopieren?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Damit ein typumwandlung stattfinden - meinst das sollte auch im funktionskopf möglich sein?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nope :(

var nodeFormats = map[int64]nodeBuilder{
1: BuildNodesV1,
2: BuildNodesV2,
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wie wäre es mit zwei output-Plugins für die Versionen?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dann wären zweimal der graph builder notwendig,
auch wenn der vom anderen Plugin importierbar wäre.
(Ist für mich nicht DRY)
Außerdem ist es für die History der Meshviewer interessant. (Die Version 1 und 2 stammen ja aus ffnord)

return enable.(bool)
}
return false
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Diese Funktion gibt es vier mal in zwei unterschiedlichen Schreibweisen. Geht das auch DRY?

if v, ok := f["no_owner"]; ok {
return v.(bool)
}
return true
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

das geht kürzer

@genofire
Copy link
Member Author

Danke für die Anregungen

@genofire genofire added wip and removed review labels Oct 17, 2017
@FreifunkBremen FreifunkBremen deleted a comment from codecov-io Oct 18, 2017
@codecov-io
Copy link

codecov-io commented Oct 19, 2017

Codecov Report

Merging #63 into master will increase coverage by 13.93%.
The diff coverage is 99.45%.

Impacted file tree graph

@@             Coverage Diff             @@
##           master      #63       +/-   ##
===========================================
+ Coverage   59.43%   73.36%   +13.93%     
===========================================
  Files          24       37       +13     
  Lines         843     1164      +321     
===========================================
+ Hits          501      854      +353     
+ Misses        323      299       -24     
+ Partials       19       11        -8
Impacted Files Coverage Δ
output/meshviewer/node.go 100% <ø> (ø)
data/nodeinfo.go 0% <ø> (ø) ⬆️
runtime/config.go 100% <ø> (ø) ⬆️
respond/collector.go 26.41% <0%> (-2.25%) ⬇️
output/output.go 100% <100%> (ø)
runtime/nodes.go 92.8% <100%> (+0.49%) ⬆️
output/internal.go 100% <100%> (ø)
output/all/filter_noowner.go 100% <100%> (ø)
output/all/filter.go 100% <100%> (ø)
runtime/stats.go 100% <100%> (ø) ⬆️
... and 30 more

@genofire genofire added review and removed wip labels Oct 19, 2017
@genofire genofire changed the title [TASK] improve output (to stats page and filtering in meshviewer) [TASK] improve output (filtering, fix links type, new outputs stats page, nodelist for freifunkapi, meshviewer ffrgb NextGen) Oct 19, 2017
@genofire
Copy link
Member Author

genofire commented Oct 25, 2017

  • link source+target in map -> deletes other links to target
  • target-tq should be source-tq if not set

Close()
assert.Equal(1, conn.CountSave)
Copy link
Member Author

@genofire genofire Oct 27, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hab keine Erklärung, wie hier jemals eine 0 entstehen kann ->
https://travis-ci.org/FreifunkBremen/yanic/jobs/293724350#L529

Enabled bool `json:"enabled,omitempty"`
Branch string `json:"branch,omitempty"`
Enabled bool `json:"enabled"`
Branch string `json:"branch"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think branch is fine omitempty

Copy link
Member

@corny corny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bitte wirf das template Output-Plugin raus. Der Nutzen erschließt sich mir nicht.

@genofire genofire force-pushed the file-output branch 2 times, most recently from 616596d to da6096e Compare October 31, 2017 22:39
@genofire genofire changed the title [TASK] improve output (filtering, fix links type, new outputs stats page, nodelist for freifunkapi, meshviewer ffrgb NextGen) [TASK] improve output (filtering, fix links type, new outputs nodelist for freifunkapi + meshviewer-ffrgb NextGen) Oct 31, 2017
@genofire genofire changed the title [TASK] improve output (filtering, fix links type, new outputs nodelist for freifunkapi + meshviewer-ffrgb NextGen) [TASK] improve output (filtering, fix links type, new outputs nodelist for freifunkapi and meshviewer-ffrgb v10 NextGen) Nov 1, 2017
@genofire genofire force-pushed the file-output branch 2 times, most recently from 0041925 to 0bed780 Compare November 1, 2017 08:00
…t for freifunkapi and meshviewer-ffrgb v10 NextGen)
enable = true
path = "/var/www/html/meshviewer/data/meshviewer.json"


Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Du verwendest mal doppelte und mal einfache Klammern für die Sections. Hat das einen Grund?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nö xD

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doch, das sind Array-Einträge mit "[[...]]" dadurch können mehrere datenbanken oder outputs configuriert werden.
z.B. output ohne Filter und eine mit Filter, das owner angezeigt wird (für eine hidden Meshviewer)
oder ein Meshviewer nur für Walle, um die auf deren Seite einzubinden.
... es gibt viele Möglichkeiten

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dann erkläre das bitte in der Config-Datei.

@corny corny merged commit 46d07c5 into master Nov 1, 2017
@corny corny deleted the file-output branch November 1, 2017 10:31
genofire added a commit that referenced this pull request Nov 1, 2017
…t for freifunkapi and meshviewer-ffrgb v10 NextGen) - #63
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants