98_apptime -> HandleTimeout/CallFn Redefinition?

Begonnen von RichardCZ, 22 März 2020, 14:22:36

Vorheriges Thema - Nächstes Thema

RichardCZ

Kann mir jemand sagen wie das gedacht ist?

fhem.pl definiert HandleTimeout und CallFn, 98_apptime auch. Im selben namespace.

Ist es so gedacht, dass sobald man apptime startet, die "HandleTimeout" funktion von apptime - bis zum Restart das Sagen hat?
Die Funktionen sind sich sehr ähnlich, die apptime Version hat ein paar Hooks mehr. Könnte man das nicht parametrieren?

Witty House Infrastructure Processor (WHIP) is a modern and
comprehensive full-stack smart home framework for the 21st century.

rudolfkoenig

Theoretisch ja, die Funktionen sind aber performance-kritisch, und ich habe den Verdacht, dass die Schwelle zu senken zu Missbrauch verleitet.

RichardCZ

Zitat von: rudolfkoenig am 22 März 2020, 14:42:40
Theoretisch ja, die Funktionen sind aber performance-kritisch, und ich habe den Verdacht, dass die Schwelle zu senken zu Missbrauch verleitet.

Ok. M.a.W. das hier wird bei apptime Nutzung im Log erwartet.

2020.03.22 15:02:22 1: PERL WARNING: Subroutine HandleTimeout redefined at ./FHEM/98_apptime.pm line 36.
2020.03.22 15:02:22 1: PERL WARNING: Subroutine CallFn redefined at ./FHEM/98_apptime.pm line 114.


Ich vermute apptime wird jetzt nicht von so vielen Leuten benutzt. Die Doku hat ein paar Ungenauigkeiten:

startet man apptime, kommt

apptime initialized

Use apptime [clear|<field>|timer|nice] [top|all] [<filter>],application function calls and duration


Gut, das verstehe ich jetzt nicht so, also schaue ich mit "help apptime" nach. Da steht unter anderem

apptime [count|function|average|clear|max|name|total] [all]
Display a table sorted by the field selected.

all will display the complete table while by default only the top lines are printed.


So wie da die BNF steht, müsste "apptime all" ein valider Befehl sein, aber wenn man das versucht, kommt

all undefined field, use one of average,avgDly,clear,cont,count,function,max,maxDly,name,nice,pause,timer,total


Von avgDly weiß wiederum help nix (ich vermute es wird ein Average Delay sein?), ebensowenig wie von nice.
Ich denke, so ein eingebautes Profiling ist ne super Sache, aber die Doku macht es da einem nicht gerade leicht.

"apptime param Max call" tut auch nicht - wie gesagt, ein wenig hermeneutisch all das.

---

Dann bekomme ich beim apptime Malträtieren ziemlich häufig

2020.03.22 15:14:57 3: FHEMWEB WEB CSRF error: csrf_161079738171018 ne csrf_589756154973598 for client WEB_127.0.0.1_58414 / command apptime param Max call. For details see the csrfToken FHEMWEB attribute.

Nicht immer, aber häufig. Da bin ich mir jetzt nicht sicher ob das bekannt ist, oder ob ich da was kaputt gemacht habe.
Witty House Infrastructure Processor (WHIP) is a modern and
comprehensive full-stack smart home framework for the 21st century.