Browse Source

Transférer les fichiers vers 'docs'

master
joanluc 4 months ago
parent
commit
7225957ecc
  1. 52
      docs/consoData.org

52
docs/consoData.org

@ -0,0 +1,52 @@
#+ FILE: consoData.org
#+ AUTHOR:joanluc
#+ DESCRIPTION: mesure de la consommation de donnees d'un process
Dans la problématique de la gestion de consommation de données pour des abonnements téléphoniques de base, il est utile de connaitre la consommation de données de chaque application
* Notebook
```
$ python
Python 3.9.0 (default, Oct 8 2020, 15:55:37)
[Clang 9.0.8 (https://android.googlesource.com/toolchain/llvm-project 98c855489 on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> c0=2.7
>>> c1=3.3
>>> cLoginPrompt=c1-c0
>>> print(format(cLoginPrompt))
0.5999999999999996
>>> c3=3.54
>>> cLoginProc=c3-c1
>>> print(format(cLoginProc))
0.2400000000000002
>>> c4=3.74
>>> cZimbra=c4-c3
>>> print(format(cZimbra))
0.20000000000000018
```
* Algorithme
class procDataConso():
. def __init__(self,nomProc):
. self.nomPric= nomProc
. . def __setThreads(self,nbr):
... ... self.threads=dict()
. ... for i in range(0,nbr):
.. . .. . self.threads[i]=("thread_"+format[i],c[i])
.. def __getMeasure(self,measureMedia="manuel"):
..... .if (measureMedia=="manuel"):
.... ... return (input("Mesute ?"))
.... else:
. . ... pass
...def dataConsoMeasure(self,c0):
.. ... c1=self.__getMeasure()
..... . return (c1-c0)
. . def dataConsoReg(self,measure):
...... for i in range(0,len(self.threads()) ):
.... . . ..thread=input("Nom thread ?","")
..... .... c=self.dataConsoMeasure(self,c[i-1])
... . .... self.threads[i]=(nm[i],"thread_"+format (i),c)
def test_procDataConso():
.. myConso=procDataConso(input("Nom process ? "))
... myConso.dataConsoReg(self,measure)
if __name__ == "__main__":
.. test_procDataConso()
Loading…
Cancel
Save