Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
Rbase
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
courses
Rbase
Commits
5ebfd5ce
Commit
5ebfd5ce
authored
8 years ago
by
Elisabetta Ronchieri
Browse files
Options
Downloads
Patches
Plain Diff
Update total_ram.R
parent
4015be33
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dati/monitoring/total_ram.R
+12
-5
12 additions, 5 deletions
dati/monitoring/total_ram.R
with
12 additions
and
5 deletions
dati/monitoring/total_ram.R
+
12
−
5
View file @
5ebfd5ce
# Caricare i dati di total ram esportati da graphana per colonna
df
<-
read.csv2
(
"grafana_data_total_ram_export_column.csv"
,
skip
=
2
,
as.is
=
T
,
header
=
F
)
# Assegnare nomi alle colonne del data frame
names
(
df
)
<-
c
(
'data'
,
'mem'
)
# Assegnare il valore NA ai valori null
df
[,
2
][
which
(
df
[
2
]
==
'null'
)]
<-
NA
# Convertire in numeri i dati della mem
df
[
2
]
<-
as.numeric
(
df
[,
2
])
# Convertire il tipo della variabile data
df
$
data
<-
as.POSIXct
(
strptime
(
df
[,
1
],
"%Y-%m-%dT%H:%M:%S"
),
"%Y-%m-%d %H:%M:%S"
)
df
plot
(
df
[,
'data'
],
df
[,
'mem'
])
as.Date
(
df
$
data
,
"%Y-%m-%d %H:%M:%S"
)
# Visualizzare la serie temporale usando diverse funzioni grafiche
# 1. plot
plot
(
df
[,
'data'
],
df
[,
'mem'
])
# 2. plot_ly
library
(
plotly
)
plot_ly
(
df
,
x
=
~
data
,
y
=
~
mem
,
text
=
paste
(
as.Date
(
df
$
data
,
"%Y-%m-%d %H:%M:%S"
)))
df
# 3. ggplot
library
(
ggplot2
)
ggplot
(
df
,
aes
(
x
=
data
,
y
=
mem
))
+
geom_point
()
df
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment