Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
K
klee_tutorial
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
Niklas Lundberg
klee_tutorial
Commits
d1490adf
Commit
d1490adf
authored
4 years ago
by
Blinningjr
Browse files
Options
Downloads
Patches
Plain Diff
Implemented cli skeleton
parent
16b0c98f
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
srp_analysis/Cargo.toml
+1
-0
1 addition, 0 deletions
srp_analysis/Cargo.toml
srp_analysis/src/main.rs
+43
-8
43 additions, 8 deletions
srp_analysis/src/main.rs
with
44 additions
and
8 deletions
srp_analysis/Cargo.toml
+
1
−
0
View file @
d1490adf
...
...
@@ -7,3 +7,4 @@ edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
structopt
=
{
version
=
"0.3"
}
This diff is collapsed.
Click to expand it.
srp_analysis/src/main.rs
+
43
−
8
View file @
d1490adf
...
...
@@ -4,19 +4,54 @@ mod srp_analyser;
use
common
::
*
;
use
srp_analyser
::
*
;
use
std
::
path
::
PathBuf
;
use
structopt
::
StructOpt
;
#[derive(Debug,
StructOpt)]
#[structopt(name
=
"srp_analysis"
,
about
=
"Preforms srp analysis."
)]
struct
Opt
{
/// Approximate preemptions
#[structopt(short,
long)]
approx
:
bool
,
/// Input file, example input if not present
#[structopt(parse(from_os_str))]
input
:
Option
<
PathBuf
>
,
/// Output file, stdout if not present
#[structopt(parse(from_os_str))]
output
:
Option
<
PathBuf
>
,
}
fn
main
()
{
let
tasks
:
Tasks
=
create_tasks
();
println!
(
"tasks {:?}"
,
&
tasks
);
println!
(
"tot_util {}"
,
total_load_factor
(
&
tasks
));
fn
main
()
{
let
opt
=
Opt
::
from_args
();
println!
(
"{:?}"
,
opt
);
let
tasks
:
Tasks
=
match
opt
.input
{
Some
(
_file
)
=>
create_tasks
(),
// TODO: Implement so that the tasks can be read from file.
None
=>
create_tasks
(),
};
let
(
ip
,
tr
)
=
pre_analysis
(
&
tasks
);
println!
(
"ip: {:?}"
,
ip
);
println!
(
"tr: {:?}"
,
tr
);
let
analysis
=
analyse
(
&
tasks
,
&
ip
,
&
tr
,
opt
.approx
);
match
opt
.output
{
Some
(
_file
)
=>
(),
// TODO: Implement so that the analysis can be saved to file.
None
=>
{
println!
(
"tasks {:?}"
,
&
tasks
);
println!
(
"tot_util {}"
,
total_load_factor
(
&
tasks
));
println!
(
"ip: {:?}"
,
ip
);
println!
(
"tr: {:?}"
,
tr
);
let
analysis
=
analyse
(
&
tasks
,
&
ip
,
&
tr
,
true
);
println!
(
"Analysis {:#?}"
,
analysis
);
println!
(
"Analysis {:#?}"
,
analysis
);
// TODO: Implement a nicer print out to stdout.
},
};
}
...
...
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