Pages

Sunday, April 3, 2016

RIDC sample code to get Network Speed , UCM server capacity ,upload status

RIDC sample code to get Network Speed , UCM server capacity ,upload status 



This is mainly intended for large file upload ( 1.5 GB+).

JDK 1.8+ required .

Purpose : Sample code to provide
1.Status of upload process
2.Speed of network
3. Capacity of UCM server

UCM checkin process has 3 main file process

1. Send file to UCM server , UCM server keeps this file in temp directory of UCM server
2. Copy this temp file to Native File Location
3. Delete the Temp file created
4. Wait for the conversion and if there is no conversion copy Native File to Web layout

To get valid response from UCM server step 1,2,3 should be over . This code will help us to get speed of step1 ( Network speed ) , step 2&3 for the UCM capacity






Detailed Steps :

1. Download code  from : https://github.com/sterin501/CheckinSpeed.git


2.Edit config.properties

with URL , primary file etc

3. Run the code like

. ./classpath

java SpeedTest

4. Sample output ( for 1.5 GB file )

Size of file in bytes 1602782395
Size of file in KB 1565217.0
Size of file in MB 1528.5322265625
Starting Uploadler
Sending File to UCM ----->

hostname is 10.184.36.144
Sec is myrealm
Time out value is 780000
@Properties LocalData
UserDateFormat=iso8601
IdcService=CHECKIN_UNIVERSAL
UserTimeZone=UTC
dDocTitle=Test RIDC Checkin 1565217.0
dDocType=Document
dDocAccount=
dSecurityGroup=Public
@end
----->5% speed 78260.85 KB/sec ETA 19.0 sec
----->14% speed 109565.19 KB/sec ETA 12.285714285714285 sec
----->23% speed 119999.97 KB/sec ETA 10.043478260869565 sec
----->32% speed 125217.36 KB/sec ETA 8.5 sec
----->42% speed 131478.228 KB/sec ETA 6.904761904761905 sec
----->50% speed 130434.75 KB/sec ETA 6.0 sec
----->60% speed 134161.45714285714 KB/sec ETA 4.666666666666668 sec
----->68% speed 133043.445 KB/sec ETA 3.7647058823529402 sec
----->68% speed 118260.84 KB/sec ETA 4.23529411764706 sec
----->75% speed 117391.275 KB/sec ETA 3.333333333333334 sec
----->76% speed 108142.26545454546 KB/sec ETA 3.473684210526315 sec
----->76% speed 99130.41 KB/sec ETA 3.7894736842105257 sec
----->77% speed 92709.00692307693 KB/sec ETA 3.8831168831168803 sec
----->77% speed 86086.935 KB/sec ETA 4.181818181818183 sec
----->77% speed 80347.806 KB/sec ETA 4.480519480519483 sec
----->77% speed 75326.068125 KB/sec ETA 4.779220779220779 sec
----->77% speed 70895.12294117647 KB/sec ETA 5.077922077922079 sec
----->77% speed 66956.505 KB/sec ETA 5.376623376623375 sec
----->77% speed 63432.478421052634 KB/sec ETA 5.675324675324674 sec
----->77% speed 60260.8545 KB/sec ETA 5.974025974025974 sec
----->77% speed 57391.29 KB/sec ETA 6.272727272727273 sec
----->79% speed 56205.51954545455 KB/sec ETA 5.848101265822784 sec
----->92% speed 62608.68 KB/sec ETA 2.0 sec
-->100%

time took only for file transfer is 23 sec
Network Speed between client & UCM server is 68052.91304347826 KB/sec
Network Speed between client & UCM server is 66.45792289402173MB/sec
ContentID is STJACOBPC1IDCO001819

Time took in UCM server is 45.422 sec
Processing Capacity of your environment 34459.44696402624 KB/s
Processing Capacity of your environment 34.45944696402624 MB/s






Java details :

1. Java main class to define the thread class
2. In the thread demo class , start () should contain the upload process
3. run () used to track the upload process

4. There will be different class which deals  with RIDC action should be refer by step 2 

No comments:

Post a Comment