Historical dataload


#1

I am sending data to influx for a historical load. I am using precicion=s and calculating epoc time in total seconds as the date. When i look at the data in grafana it shows it to me as a different date, thoughts?
inputfile:

“NonCloudTotal_ProtectedSize”,“GrandTotal_ProtectedSize”,“BU”,“CloudImageTotal_JobSize”,“NonCloudTotal_JobSize”,“GrandTotal_JobSize”,“CloudNonImageTotal_JobSize”,“CloudImageTotal_ProtectedSize”,“CloudNonImageTotal_ProtectedSize”,“Date”
“721445”,“825283”,“CORP-TEST1”,“386”,“48,097”,“49,457”,“974”,“7753”,“96085”,“2016-01”

powershell script:

$uri = “http://somehost:8086/write?db=test&precicion=s
$datasource1 = import-csv “E:\data\scripts\output\Billing-Report\Billing-History1.csv”
$datasource1|ft

foreach ($item in $datasource1){
Write-Host “starting loop”

$datevar=$item.Date
write-host “echo datevar $datevar”
$endd=(get-date -Date $datevar).ToString(“yyyy/MM/dd 00:00:01”)
write-host “echo new data $endd”
$epoc=(New-TimeSpan -Start 01/01/1970 -End $endd).TotalSeconds
write-host “echo totalseconds $epoc”

$bu = $item.bu
$NonCloudTotal_ProtectedSize = $item.NonCloudTotal_ProtectedSize.Replace(",","")
$NonCloudTotal_JobSize = $item.NonCloudTotal_JobSize.Replace(",","")
$CloudImageTotal_ProtectedSize = $item.CloudImageTotal_ProtectedSize.Replace(",","")
$CloudImageTotal_JobSize = $item.CloudImageTotal_JobSize.Replace(",","")
$CloudNonImageTotal_ProtectedSize = $item.CloudNonImageTotal_ProtectedSize.Replace(",","")
$CloudNonImageTotal_JobSize = $item.CloudNonImageTotal_JobSize.Replace(",","")
$GrandTotal_ProtectedSize = $item.GrandTotal_ProtectedSize.Replace(",","")
$GrandTotal_JobSize = $item.GrandTotal_JobSize.Replace(",","")

Invoke-RestMethod -uri $uri -Method Post -ContentType “application/json” -body “BuBilling,BU=$BU NonCloudTotal_ProtectedSize=$NonCloudTotal_ProtectedSize,NonCloudTotal_JobSize=$NonCloudTotal_JobSize,CloudImageTotal_ProtectedSize=$CloudImageTotal_ProtectedSize,CloudImageTotal_JobSize=$CloudImageTotal_JobSize,CloudNonImageTotal_ProtectedSize=$CloudNonImageTotal_ProtectedSize,CloudNonImageTotal_JobSize=$CloudNonImageTotal_JobSize,GrandTotal_ProtectedSize=$GrandTotal_ProtectedSize,GrandTotal_JobSize=$GrandTotal_JobSize $epoc”

}

select statement results
name: BuBilling
time BU CloudImageTotal_JobSize CloudImageTotal_ProtectedSize CloudNonImageTotal_JobSize CloudNonImageTota
l_ProtectedSize GrandTotal_JobSize GrandTotal_ProtectedSize NonCloudTotal_JobSize NonCloudTotal_ProtectedSize



1451606401 CORP-TEST1 386 7753 974 96085
49457 825283 48097 721445

grafana table:

Time BuBilling.CloudImageTotal_JobSize
2015-12-31 18:00:01 386.00


#2

I think i found the reason or fix, just not sure on the why now. In grafana i had to change the timezone setting to utc.