Commit Graph

59 Commits

Author SHA1 Message Date
Witek Bedyk aea6e4858d Remove project content
This is step 2 of the project retirement process as described in [1].
Project retirement has been anounced here [2].

[1] https://docs.opendev.org/opendev/infra-manual/latest/drivers.html#step-2-remove-project-content
[2] http://lists.openstack.org/pipermail/openstack-discuss/2020-August/016830.html

Depends-On: https://review.opendev.org/751987
Change-Id: Id4c4f95fee1787e23a3156933c40c491f298128e
2020-10-22 15:11:34 +02:00
Hisashi Osanai 28251697fc Fix Sparck StreamingListener for monasca-analytics
From Spark 2.2, it is necessary to implement the onStreamingStarted
method. This patch adds the method.

Change-Id: If2d9ef8ffad879319bceacad92dcf8e3d125f63e
2019-11-02 05:32:14 +00:00
Daisuke Fujita fcfd3bbc5f Improve Unittests
Delete unnecessary unittests.

Change-Id: I88c2f517c25e6449f6013e39f78605b52bdf78f0
2019-09-12 06:42:59 -07:00
Daisuke Fujita 6c7316ebbd Support python3.5 for monasca-analytics
This patch implements followings for py35 support using six(er) and 2to3.

- Python 3 map/filter returns iterator, must be converted to list
- use six.string_types instead of basestring
- use six.iteritems instead of iteritems
- use six.moves for using cPickle and SocketServer packages
- use six.assertCountEqual instead of assertItemsEqual
- remove relative imports
- update BytecodeAssembler(monasca_analytics/
  banana/bytecode/assembler.py) for python3

Can be tested with:
  tox -e py35

Change-Id: If1b92d0ffc56492950f6a02ebdbe1596d0dce368
2019-01-28 09:47:45 +00:00
Zuul 627562cacf Merge "Remove empty files" 2019-01-22 10:14:09 +00:00
Daisuke Fujita 5809e66874 Fix unit tests for py27 and pep8 jobs
Some unit tests fail after "fix pep8 job" patch[1] was merged.
Fix unit tests for passing the py27/pep8 jobs.

This patch will be part of the update for python3.

[1] https://review.openstack.org/#/c/601606/

Change-Id: I418c5596f96f3994fbfc1651917c4e930b52a425
2018-11-07 02:27:22 +00:00
Doug Hellmann ac47c5fc58 fix pep8 job
Update the cap on flake8 to support newer versions that work with
python3.

Update tox settings for pep8 environment to use python 3.

Ignore the error caused by not having 2 blank lines before functions and
classes.

Fix 2 syntax errors in function definitions.

Change-Id: I4da79ceefcbf1c23d217716f7b25ac6a092794ff
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-09-11 10:12:21 -04:00
Nguyen Hung Phuong 0e3d22199f Remove empty files
monasca_analytics/exception/aggregator.py
monasca_analytics/exception/ml.py
monasca_analytics/exception/sink.py
monasca_analytics/exception/source.py
test/config/test_connections.py
are empty files. We probably should delete it.

Change-Id: I7b6b3f90da3d11888f84f5e8efe0996598b875fb
2017-12-28 19:55:27 +07:00
Jenkins e9fdb1fa8c Merge "Add __ne__ built-in function" 2017-03-28 04:45:07 +00:00
Hisashi Osanai 75999b9d6e Fix typos
Change-Id: I9fc28742ecbd0cf8d5bcadd7c330e428aa6460bc
2017-01-16 00:39:36 +00:00
Hisashi Osanai 5f9495f0e4 Add Svc as a SML
This patch adds a SML which uses Svc (Support Vector Classifier)
algorithm (supervised).

Change-Id: I8d5d7bd6aeaff4e325ffed206e9f1f1cd23a4612
2017-01-09 10:39:52 +00:00
Hisashi Osanai a061e26741 Add RandomForestClassifier as a SML
This patch adds a SML which uses RandomForestClassifier algorithm
(supervised).

Change-Id: I6d7f3edb1fbf386a0fd287a74ca6c12b55ad4aff
2017-01-09 09:20:22 +00:00
Hisashi Osanai 835a033681 Add LogisticRegression as a SML
This patch adds a SML which uses LogisticRegression algorithm
(supervised).

Change-Id: Ibf3e31f1976eb8beca42d33e74bb65aebba6599e
2017-01-09 09:05:31 +00:00
Hisashi Osanai 7cc09363b1 Add DecisionTreeClassifier as a SML
This patch adds a SML which uses DecisionTreeClassifier algorithm
(supervised).

Change-Id: I7e4ebe07824418d733c77c6f4750893836ecdd70
2017-01-09 08:58:30 +00:00
Hisashi Osanai 491e1b2b07 Add EllipticEnvelope as a SML
This patch adds a SML which uses EllipticEnvelope algorithm
(unsupervised).

Change-Id: I7c4357c848e9246dff009dd22bc4411517db6c5a
2017-01-09 08:52:13 +00:00
Jenkins 00790907fe Merge "Fix typo" 2017-01-09 07:01:47 +00:00
Hisashi Osanai 6bf6c14130 Add IsolationForest as a SML
This patch adds a SML which uses IsolationForest algorithm (unsupervised).

Change-Id: I77a288e530bd38544d2cce9bf9ed6bdda235b218
2017-01-02 07:42:20 +00:00
Hisashi Osanai c71b47f847 Fix typo
Change-Id: If49a453ed56b5f43764ac8c57ed44e856fed3de8
2016-12-27 14:42:18 +00:00
Daisuke Fujita 2861f29bfe Deduplicate an initialization code
Change-Id: Ice714291da011e6fb4eb2ba5777ac5b0dab71a50
2016-12-08 10:09:20 +00:00
gecong1973 c9ea9be579 Add __ne__ built-in function
In Python 3 __ne__ by default delegates to __eq__ and inverts the
result, but in Python 2 they urge you to define __ne__ when you
define __eq__ for it to work properly [1].There are no implied
relationships among the comparison operators. The truth of x==y
does not imply that x!=y is false. Accordingly, when defining __eq__(),
one should also define __ne__() so that the operators will behave as
expected.
[1]https://docs.python.org/2/reference/datamodel.html#object.__ne_

Change-Id: I52633a8a4b19c5e0c0d7d786f21770496e128c7a
2016-11-24 10:00:01 +08:00
Jenkins 281fee265d Merge "Add Banana specific APIs to typecheck and get list of components." 2016-11-15 21:31:09 +00:00
Joan Varvenne 716a72d9b9 Add Banana specific APIs to typecheck and get list of components.
This commit add two APIs:

 * POST /banana/typeck { "content": "<banana>" }

   This API type check the provided banana content but does not
   evaluate it.

 * POST /banana/metadata { "content": "<banana>" }

   This API returns the associated TypeTable of the provided banana
   content. This is useful to provide auto-completion in an editor.

 * GET /banana/metadata

   This API returns the list of components availables. This is also
   useful to provide auto-completion on existing components in an
   editor for banana.

Change-Id: I31c1de86fe420458ac98aad9d9c8ae6ca73fcc81
2016-11-04 11:26:17 +00:00
Luong Anh Tuan 05f12bfffa Remove xrange for run both Python 2 and Python 3
In python 3, range() does what xrange() used to do and xrange() does not
exist. If you want to write code that will run on both Python 2 and
Python 3, you can't use xrange().

range() can actually be faster in some cases - eg. if iterating over the
same sequence multiple times. xrange() has to reconstruct the integer
object every time, but range() will have real integer objects.
(It will always perform worse in terms of memory however)

xrange() isn't usable in all cases where a real list is needed.
For instance, it doesn't support slices, or any list methods.

Change-Id: I5233438a864bb00d04ba7fb2b1688cacb0473691
2016-10-12 11:40:05 +07:00
Jenkins 92c0f6eeec Merge "Improve error message and span calculation." 2016-10-04 09:47:52 +00:00
Luong Anh Tuan f61638b52a Fix a typo in documentation
fix wrong if

Change-Id: I24ba183824788978d4d3b6ee69e5496ce0cb67de
2016-10-04 10:54:08 +07:00
Joan Varvenne 8313692991 Improve error message and span calculation.
Change-Id: I2c319e97329bd31eae875ab48eae0476bbf979e2
2016-09-21 15:55:24 +01:00
Joan Varvenne 7986ab2466 Fix crash when there's no connection in the banana file.
Change-Id: I4e587316e51eb4f9485624a7e35bfc69ffe3b7e4
2016-09-21 15:22:26 +01:00
Joan Varvenne a2a315fb5e Improve speed in data generation while preserving semantics.
This make the fake data generation much faster and configurable.
For the cloud example, the phase 2 is now triggered in less than 5
seconds instead of 6 minutes.

Change-Id: I9967c94d28a380fa19afe9275e769f1465f4f922
2016-09-20 10:33:48 +01:00
Joan Varvenne 981a5805e2 Fix the Cloud example as it was broken.
Change-Id: If5222d7737e3efb77a519e877d471949985ca5fa
2016-09-19 17:37:29 +01:00
Jenkins 1443085cb7 Merge "Make it possible to pick the number of samples used for SVM." 2016-09-16 10:54:36 +00:00
Joan Varvenne 4c05018883 Make it possible to pick the number of samples used for SVM.
Change-Id: I72b625fcefd4b8fa87cc49f71a847e8223395305
2016-09-16 10:50:51 +01:00
Jenkins 42809e2176 Merge "Fix the broken iptable example." 2016-09-14 16:03:06 +00:00
Joan Varvenne 2cdc21c7e0 Fix the broken iptable example.
Change-Id: I7936322021a409b250204a5bce515e14a879b279
Co-Authored-By: Joan Varvenne <joan.varvenne@hpe.com>
Co-Authored-By: David Subiros Perez <david.perez5@hpe.com>
2016-09-14 11:31:54 +01:00
Joan Varvenne a24622d4c0 Fix crash issue.
We will need more investigation when we want to re-enable
checkpointing.

Change-Id: I9340fd25b0e4d494bfd891cc7a5ddaa4fbdd5842
Co-Authored-By: David Subiros Perez <david.perez5@hpe.com>
Co-Authored-By: Joan Varvenne <joan.varvenne@hpe.com>
2016-09-14 11:22:13 +01:00
Joan Varvenne 5812bd8429 This commit introduces the first version of Banana configuration language.
As of this commit, to change the configuration using Banana, we
need to make an HTTP POST request to `/banana` REST API. This API is
temporary and is likely to be changed later.

The implementation is done entirely in the `banana` module. Under this
module there are:

 * `typeck` module contains the type checker,
 * `grammar` module contains the parser and the AST and,
 * `eval` module contains the interpreter.

Additionally, a test framework has been created to ease the test of
particular conditions of the language.

Within the banana module, there is a README.md file for each associated
sub-module explaining further the details of the language.

Once this commit is merged, there's still a lot that can be improved:

 - All components should be tested in Banana.
 - The 'deadpathck' pass could be improved (see TODO)
 - We don't support generated JSON ingestors yet.
 - Imports will be key for reusability (not implemented).

Change-Id: I1305bdfa0606f30619b31404afbe0acf111c029f
2016-08-22 14:29:26 +01:00
Joan Varvenne 154594f929 Add tests for monasca_derivative.
Change-Id: I53b5e42fbae1a057e73b33a7a5f20f4f7cc513ad
2016-07-08 12:41:23 +01:00
Jenkins bb4dd7a55b Merge "Fix some bugs with Aggregate and Combine. Add some tests as well." 2016-07-07 12:08:31 +00:00
yuyafei 5d34876f77 Correct reraising of exception
When an exception was caught and rethrown, it should call 'raise'
without any arguments because it shows the place where an exception
occured initially instead of place where the exception re-raised.

Change-Id: Id8b2e36a20821dfcea9c60c3c4ea74a40f2ec7fe
2016-07-07 19:03:49 +08:00
Joan Varvenne 9b29257102 Fix some bugs with Aggregate and Combine. Add some tests as well.
Change-Id: I553f419e4a142ac19c54b4137f12ac26bbd66efa
2016-07-07 08:49:43 +01:00
Joan Varvenne efab8ebc13 Reduce duplication in tests. Add test for banana.
Change-Id: I456b94e9a50a82d6618746826a0a4dc31c1e88bc
2016-07-06 10:04:24 +01:00
Joan Varvenne b93b416fb4 Add the test back and include BytecodeAssembler in tree.
Change-Id: I5ef7469cb98d05cb78b27c5a6455d366885c1143
2016-07-05 11:11:34 +01:00
David Subiros Perez 4c14dace26 migrated config checking library from schema to voluptuous
Change-Id: I371db2461a7ecb216f00b99aaf8296bde42f02f7
2016-07-01 17:53:17 +01:00
Jenkins b1db54f22b Merge "Add basic analytics for Monasca metrics" 2016-07-01 09:56:06 +00:00
Joan Varvenne 3f5fc11f31 Add basic analytics for Monasca metrics
This commit introduces 3 examples of LDPs that process
monasca metrics:

 * `Aggregate` - compute simple stats per metric name.
 * `Combine` - allow mixing of different metrics by providing
   a simple expression parser that gets transformed into
   CPython bytecode.
 * `Derivative` - compute a metric derivative.

While quite simple, those examples, will help us improve the
framework by emphazing some of the problems we will face when
working on more complex solution such as:

 * Spark's inability to share data between sliding windows.
 * Ordering of data.
 * Sampling of metrics / events.

Change-Id: I259022f20e9b288aa2a08c24ad4a5f41a20e6095
2016-07-01 00:20:22 -06:00
Hisashi Osanai f01c08ccbc Remove unnecessary comment
Change-Id: I38835386c06c702b814226b995cdce7728e9f478
2016-07-01 05:22:51 +00:00
Hisashi Osanai 9bce2e15af Fix Apache license and PYTHONPATH for the gate
This patch fixes followings:
*two lines of Apache license in order to pass H103
*using homedir in PYTHONPATH

Co-Authored-By: Daisuke Fujita <fuzita.daisuke@jp.fujitsu.com>
Change-Id: I8fbe26ae8547879fdda0f840bfc5d582e0395588
2016-06-28 15:03:27 +09:00
Hisashi Osanai 56f05fa1da H238 support
This patch provies H238 support.

Change-Id: I91b6321a3517ce92cef62e6df1be0d7caf9eb82d
2016-06-06 09:36:13 +00:00
Jenkins 3881d2095e Merge "H306 support" 2016-06-06 09:22:36 +00:00
Jenkins 457197808b Merge "H236 support" 2016-06-06 09:15:45 +00:00
Jenkins 97ac4d83cd Merge "H101 support" 2016-06-06 09:14:45 +00:00