I'm using docker-grafana-graphite to collecting datapoints. When I request to get datapoints for last 30 days or older than one week it shows datapoints only for last week (last 7 days).
When I request to summarized datapoints for last 30 days:
/render/?target=summarize(stats.counters.test-server.comp.counter.sms_messages.count,'1hour','sum')&from=-30d&until=now&format=json
I'm getting result for only last 7 days and result looks like this:
{
target: "summarize(stats.counters.test-server.comp.counter.sms_messages.count, "1hour", "sum")",
datapoints: [
[10, 1516363200],
[5, 1516366800],
...
[2, 1516964400],
[0, 1516968000]
]
}
It works if I request for a small range less than one week, but I would like to get all datapoints for last 30 days. How can I fix this issue?
Related
This is my first question on stackoverflow, sorry if the question is poorly put.
I am currently developing a project where I predict how much a person drinks each day. I currently have data that looks like this:
The menge column represents how much water a person has actually drunk in 30 minutes (So first value represents amount from 8:00 till before 8:30 etc..). This is a 1 day sample from 3 months of data. The day starts at 8 AM and ends at 8 PM.
I am trying to forecast the Time Series for each day. For example, given the first one or two time steps, we would predict the whole day and then we know how much in total the person has drunk until 8 PM.
I am trying to model this data as a Time Series object in R (Google Colab), in order to use Croston's Method for the forecasting. Using the ts() function, what should I set the frequency to knowing that:
The data is half-hourly
The data is from 8:00 till 20:00 each day (Does not span the whole day)
Would I need to make the data span the whole day by adding 0 values? Are there maybe better approaches for this? Thank you in advance.
When using the ts() function, the frequency is used to define the number of (usually regularly spaced) observations within a given time period. For your example, your observations are every 30 minutes between 8AM and 8PM, and your time period is 1 day. The time period of 1 day assumes that the patterns over each day is of most interest here, you could also use 1 week here.
So within each day of your data (8AM-8PM) you have 24 observations (24 half hours). So a suitable frequency for this data would be 24.
You can also pad the data with 0 values, however this isn't necessary and would complicate the model. If you padded the data so that it has observations for all half-hours of the day, the frequency would then be 48.
I have a couples of weeknumbers of interest. Lets take '202124' (this week) as an example. How can I subtract x weeks from this week number?
Lets say I want to know the week number of 2 weeks prior, ideally I would like to do 202124 - 2 which would give me 202122. This is fine for most of the year however 202101 - 2 will give 202099 which is obviously not a valid week number. This would happen on a large scale so a more elegant solution is required. How could I go about this?
convert the year week values to dates subtract in days and format the output.
x <- c('202124', '202101')
format(as.Date(paste0(x, 1), '%Y%W%u') - 14, '%Y%V')
#[1] "202122" "202052"
To convert year week value to date we also need day of the week, I have used it as 1st day of the week.
I have a table in Smartsheets that has bookings in it.
If the appointment is confirmed it changes the status to scheduled. It also has a date assigned to it. I'm trying to use countifs to see how many are scheduled for the next 7 days.
This is the formula i have.
=COUNTIFS([Shoot Setup]:[Shoot Setup], "Styleshoots", [Date start]:[Date
start], >=TODAY(7))
This does not give me the correct value.
If i dont have the 7 modifier then it gives me the correct value for items scheduled from today.
But i want to just see the total for today plus 6 days 7 days in total.
Any suggestions?
The formula you've posted will return the count of rows where:
Shoot Setup = "Styleshoots"
AND
Date start is greater than or equal to seven days from today
Try using this formula instead:
=COUNTIFS([Shoot Setup]:[Shoot Setup], "Styleshoots", [Date start]:[Date start], >=TODAY(), [Date start]:[Date start], <=TODAY(7))
This formula will return the count of rows where:
Shoot Setup = "Styleshoots"
AND
Date start is greater than or equal to Today
AND
Date start is less than or equal to 7 days from today
I have two time series.
Each point in either time series is for a week. A week here is not exactly a calendar week, but the first week in a calendar year always starts from Jan 1, and the other weeks in the same year follow that, and the last week of the year may contain more than 7 days but no more than 13 days.
The first time series A is stored in a compressed (.gz) text file A.gz, which looks like (each week and the corresponding time series value are separated by a comma in a line):
week,value
20060101-20060107,0
20060108-20060114,5
...
20061217-20061223,0
20061224-20061230,0
20070101-20070107,0
20070108-20070114,4
...
20150903-20150909,0
20150910-20150916,1
The second time series B is similarly stored in a compressed (.gz) text file B.gz, but over a subset of period of A, which looks like:
week,value
20130122-20130128,509
20130129-20130204,204
...
20131217-20131223,150
20131224-20131231,148.0
20140101-20140107,365.0
20140108-20140114,45.0
...
20150305-20150311,0
20150312-20150318,364
I wonder how to calculate the cross correlation between the two time series A and B (up to a specified maximum lag), and plot A and B in a single plot, in R?
Thanks
I have a data set (3.2 million rows) in R which consists of pairs of time (milliseconds) and volts. The sensor that gathers the data only runs during the day so the time is actually the milliseconds since start-up that day.
For example, if the sensor runs 12 hours per day, then the maximum possible time value for one day is 43,200,000 ms (12h * 60m * 60s * 1000ms).
The data is continually added to a single file, which means there are many overlapping time values:
X: [1,2,3,4,5,1,2,3,4,5,1,2,3,4,5...] // example if range was 1-5 for one day
Y: [voltage readings at each point in time...]
I would like to separate each "run" into unique data frames so that I could clearly see individual days. Currently when I plot the entire data set it is incredibly muddy because in fact all of the days are being shown in the single plot. Thanks for any help.
If your data.frame df has columns X and Y, you can use diff to find every time X goes down (meaning a new day, it sounds like):
df$Day = cumsum(c(1, diff(df$X) < 0))
Day1 = df[df$Day==1,]
plot(Day1$X, Day1$Y)